I am running a powershell script, that makes a repository on a gitea server (using restAPI of gitea). But on the gitea server not everyone is allowed to initialise the repository, only some users are. How can I make my script authorize the permission that the current runner of the script has, and only then makes a repo?
the solution that I have thought till now: git uses access tokens to verify people when operations using the REST API are made. Anyone who wants to use my script will first have to make a token, then enter this token when running my script, and then my script will use this access token in the operation its doing.
Disadvantage: The user has to first make a token =(
Is there any other more elegant solution : like just directly entering the username and password. This way the user does not have to do anything new like making an access token just for my script and directly enter existing username and password which they use to enter the gitea server. Thank you for your time =)
Your script could make a commit and a push (hence the need to enter username/password) to a public repository, where a post-receive hook would:
In other words, the REST API call is not made on the client side, but on the server side, where an identity check can be done first.