-
Notifications
You must be signed in to change notification settings - Fork 306
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
add gitea authn #296
add gitea authn #296
Conversation
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.
Thanks for this PR :)
I've added a few notes, in addition could you also add some documentation about using this new provider.
|
||
//func (gha *GiteaAuth) authUser(user string, password PasswordString) (err error, l Labels) { | ||
func (gha *GiteaAuth) Authenticate(user string, password api.PasswordString) (bool, api.Labels, error) { | ||
url := fmt.Sprintf("%s/v1/user/orgs", gha.getGiteaApiUri()) |
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.
You may wish to use the gitea go-sdk as it handles parsing of response, and many other helpers.
if gha.config.GiteaApiUri != "" { | ||
return gha.config.GiteaApiUri | ||
} else { | ||
return "https://git2.groschupp.org/api" |
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.
Default should be something such as https://gitea.com/api rather than a private install.
@@ -22,7 +22,7 @@ generate: | |||
github.com/cesanta/docker_auth/auth_server/server/... | |||
|
|||
build: | |||
CGO_ENABLED=0 go build -v --ldflags=--s | |||
CGO_ENABLED=0 go build -v --ldflags=--s -pkgdir /tmp/go |
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.
This change is unrelated to this PR, could you raise another PR for this change and revert it here?
if gha.config.GiteaWebUri != "" { | ||
return gha.config.GiteaWebUri | ||
} else { | ||
return "https://git2.groschupp.org" |
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.
same as above
@cgroschupp Hey, just checking if there is anything I can do to help out with this PR? I'm one of the project leads of Gitea and so I have some insight into that codebase. |
Gitea has a PR for supporting docker registry auth itself here: go-gitea/gitea#16048 |
No description provided.