Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Conversation

cgroschupp
Copy link

No description provided.

Copy link
Collaborator

@techknowlogick techknowlogick left a 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())
Copy link
Collaborator

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"
Copy link
Collaborator

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
Copy link
Collaborator

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"
Copy link
Collaborator

Choose a reason for hiding this comment

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

same as above

@techknowlogick
Copy link
Collaborator

@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.

Base automatically changed from master to main March 5, 2021 19:38
@techknowlogick
Copy link
Collaborator

Gitea has a PR for supporting docker registry auth itself here: go-gitea/gitea#16048

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants