Skip to content

generate gitea token#392

Merged
nabuskey merged 1 commit intocnoe-io:mainfrom
nabuskey:gitea-token
Oct 7, 2024
Merged

generate gitea token#392
nabuskey merged 1 commit intocnoe-io:mainfrom
nabuskey:gitea-token

Conversation

@nabuskey
Copy link
Copy Markdown
Collaborator

This PR makes idpbuilder generate a Gitea admin token. This is useful for use cases such as:

  • Cloning Gitea repositories.
  • Performing some sort of Gitea related operations. e.g. configure webhook for a repository.

Partially fixes: #378

Example output:

./idpbuilder get secrets -o json -p gitea
[
  {
    "name": "gitea-credential",
    "namespace": "gitea",
    "data": {
      "password": "E_aaaaa'",
      "token": "aaaaaa",
      "username": "giteaAdmin"
    }
  }
]

Signed-off-by: Manabu McCloskey <manabu.mccloskey@gmail.com>
@cmoulliard
Copy link
Copy Markdown
Contributor

What is the duration of the Token ? Can a user renew it ? @nabuskey

@nabuskey
Copy link
Copy Markdown
Collaborator Author

nabuskey commented Oct 4, 2024

What is the duration of the Token ? Can a user renew it ? @nabuskey

No expiration. I don't think Gitea supports it until they move to JWT: go-gitea/gitea#4793

Copy link
Copy Markdown
Contributor

@cmoulliard cmoulliard left a comment

Choose a reason for hiding this comment

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

Could also mention within the documentation that we generate a gitea token having full AdminScope to manage: repository, issues, packages, etc and that a user could use it to query the API as documented here: https://docs.gitea.com/next/development/api-usage#more-on-the-authorization-header ?

Copy link
Copy Markdown
Contributor

@blakeromano blakeromano left a comment

Choose a reason for hiding this comment

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

Looks fine as is. Just one small comment

KeepAlive: 30 * time.Second, // from http.DefaultTransport
}).DialContext,
}
return &http.Client{Transport: tr, Timeout: 30 * time.Second}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This timeout seems really long but maybe I am misunderstanding

@nabuskey nabuskey merged commit 36c22a1 into cnoe-io:main Oct 7, 2024
@nabuskey nabuskey deleted the gitea-token branch October 7, 2024 17:03
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.

Feature: Gitea auth support

3 participants