Skip to content
This repository has been archived by the owner on Mar 25, 2023. It is now read-only.

Create remote_user_repo_create function #22

Open
SimonLab opened this issue May 20, 2022 · 3 comments
Open

Create remote_user_repo_create function #22

SimonLab opened this issue May 20, 2022 · 3 comments
Assignees
Labels
awaiting-review An issue or pull request that needs to be reviewed enhancement New feature or request

Comments

@SimonLab
Copy link
Member

Create the remote_user_repo_create\2 similar to:

gitea/lib/gitea.ex

Lines 36 to 37 in 0c2bb0e

def remote_repo_create(org_name, repo_name, private \\ false) do
url = api_base_url() <> "org/#{org_name}/repos"

But using the API for creating a repository for the current user: https://gitea-server.fly.dev/api/swagger#/repository/createCurrentUserRepo

@SimonLab SimonLab added the enhancement New feature or request label May 20, 2022
@SimonLab SimonLab self-assigned this May 20, 2022
SimonLab added a commit that referenced this issue May 20, 2022
Add remote_user_repo_create to create a new repository for the
user.

related to #22
@nelsonic
Copy link
Member

@SimonLab the current user based on the GITEA_ACCESS_TOKEN ? 🤔

@SimonLab
Copy link
Member Author

SimonLab commented May 21, 2022

Yes the user linked to the access token.
I might also create a new enivornment variabl GITEA_USERNAME to define the username linked to this token which match the username on Gitea

@nelsonic
Copy link
Member

Excuse my ignorance, but doesn't the GITEA_ACCESS_TOKEN restrict the user to the owner of the token?
My reading of the API doc you shared above: POST /user/repos
https://gitea-server.fly.dev/api/swagger#/repository/createCurrentUserRepo
image

Is that the username (owner) cannot be set in this request, not even by an Admin. 💭

@SimonLab SimonLab added the awaiting-review An issue or pull request that needs to be reviewed label May 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
awaiting-review An issue or pull request that needs to be reviewed enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants