-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In HTTP-01, modularize the way of presenting the token. #32
Conversation
First, with a simple local webserver.
LGTM :) |
"time" | ||
) | ||
|
||
type httpChallengeMethod interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be exported so users can write their own (if they want to)? I realize users won't need to use the type, but maybe for documentation purposes...
Or if we don't want a user to write their own, then we can leave this unexported, I guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we do want the user to be at least be able to write their own.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit 61a0912 fixes that
This is looking pretty good. But could you fix the tests? :) |
Add a way to write a custom method when using the library
end chan error | ||
} | ||
|
||
func NewHttpChallengeWebserver(optPort string) HttpChallengeMethod { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason, the word "Webserver" is really bothering me - maybe because it's actually two words. Can we change this to NewHTTPChallengeWebServer
instead with a capital S and a capital HTTP?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case, httpChallenge can be renamed to HTTPChallenge if we change it to be exported (like I proposed in my remark to #36) ?
I'd like to discuss the following change to the type HttpChallengeSolver interface {
PresentToken(domain, token, keyAuth string) error
CleanUp() error
} This would get rid of the callback to |
^ I support this suggestion. This PR is definitely on the right track, and I think @xenolf's suggestion is a fine way to improve it. |
Any updates on this? :) |
This is a great suggestion. The task of whoever implements the interface is to provision the validation resource to an HTTP server. I therefore suggest the following naming:
Also maybe pass an identifier to the cleanup method so the provider doesn't have to store the reference to the created resource: type HttpChallengeProvider interface {
PresentToken(domain, token, keyAuth string) error
CleanUp(token) error
} |
First, with a simple local webserver.