Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: implement support for http digest auth (resolve #352)#553

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
muety wants to merge2 commits intoprometheus:main
base:main
Choose a base branch
Loading
frommuety:digest-auth

Conversation

@muety
Copy link

@muetymuety commentedDec 14, 2023
edited
Loading

Implements#352. I'd need this in blackbox exporter. Let me know what you think! :-)

Digest auth can be tested againsthttps://httpbin.org/#/Auth.

joneshf reacted with thumbs up emoji
@muetymuetyforce-pushed thedigest-auth branch 2 times, most recently from25b2e9f to1816b4bCompareDecember 14, 2023 12:27
@muety
Copy link
Author

Not sure about the linting errors, perhaps someone could give me some assistance with that?

@muety
Copy link
Author

Any chances to get this merged? Should I tag someone in here?

@SuperQ
Copy link
Member

I don't see any major issues. I do wonder about ifgithub.com/icholy/digest is the best library option for this. I haven't done any evaluation of what the available options are.

Can you describe why you picked this implementation?

@muety
Copy link
Author

Yeah, I was expecting a bit of discussion around this. I don't know about your requirements for pulling in new dependencies. I was hoping Go's standard lib had an implementation of digest auth, but turns out it doesn't. I pickedicholy/digest, because it was the only client implementation I could find.

@muety
Copy link
Author

Is there someone I could tag here who is in charge of merging my PR?

Copy link
Member

@SuperQSuperQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This needs a rebase.

Signed-off-by: Ferdinand Mütsch <ferdinand@muetsch.io>
Signed-off-by: Ferdinand Mütsch <ferdinand@muetsch.io>
@muety
Copy link
Author

Rebase done, can this be merged now?

Comment on lines +392 to +395
ifauthHeader:=r.Header.Get("Authorization");authHeader=="" {
// first request
w.Header().Set("www-authenticate","Digest realm=\""+realm+"\", nonce=\""+nonce+"\", qop=\"auth\", opaque=\"3bc9f19d8195721e24469ff255750f8c\", algorithm=MD5, stale=FALSE")
w.WriteHeader(401)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

can we refactor this test to allow varying the inputs?
There's a couple of cases I think this needs to be able to test:

  • qop=auth-int
  • different algorithms
  • algorithm=(alg)-sess vs algorithm=(alg) (all the way to include cnonces)

Later on, if we can keep some state: nextnonce support

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks for your review! I could include additional tests for different combinations of these values if requested. But I'm not sure if that's the way to go. The digest auth client library already includes tests for these (e.g. seehere). While we surely want to test that digest auth works ingeneral, I don't think it's our job to test the inner working of the library again.

Comment on lines +366 to +367
ifc.BasicAuth!=nil||c.OAuth2!=nil||c.DigestAuth!=nil{
returnfmt.Errorf("at most one of basic_auth,digest_auth,oauth2 & authorization must be configured")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

these scattered checks to ensure only one type of auth is enabled bug me: more places to go wrong.
Maybe refactor them to a function that ensures only one type of auth is configured, and drop them in as needed.

auths_enabled := []bool{  c.BasicAuth != nil,  c.OAuth2 != nil,  c.DigestAuth != nil,  c.Authorization != nil,}if len(auths_enabled) > 1 {  //  error}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Agree! I found these checks a bot strange as well and would vote for refactoring them (willing to do that!). Only wondering if this refactoring shall be included here or rather as part of another PR, so we can get this one merged preferably soon? Let me know what you think is better.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

i'm not the maintainer of this codebase, but if I had a choice, I'd say should be a separate PR that merges before this one.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Who is a maintainer and could eventually be responsible for merging my PR?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'm sorry but I'm not maintainer here, just a contributor

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Okay, sorry to bother you then. Who can I tag here to finally (!) get this finished?!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Hello???@SuperQ

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

?????

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This took me like half a day of work. Sorry, but I find it quite disrespectful that none of the maintainer even only bothers to reply.

@muety
Copy link
Author

After almost a year, I guess this is not gonna be merged then?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@SuperQSuperQSuperQ requested changes

@roidelapluieroidelapluieAwaiting requested review from roidelapluie

+2 more reviewers

@robbat2robbat2robbat2 left review comments

@mmorel-35mmorel-35mmorel-35 left review comments

Reviewers whose approvals may not affect merge requirements

Requested changes must be addressed to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@muety@SuperQ@robbat2@mmorel-35

[8]ページ先頭

©2009-2025 Movatter.jp