pr-agent icon indicating copy to clipboard operation
pr-agent copied to clipboard

gitlab_provider asign personal_access_token to oauth_token may not work?

Open wayn opened this issue 10 months ago • 5 comments

gitlab_provider asign personal_access_token to oauth_token may not work?

self.gl = gitlab.Gitlab( url=gitlab_url, oauth_token=gitlab_access_token )

may change to self.gl = gitlab.Gitlab( url=gitlab_url, private_token=gitlab_access_token )

wayn avatar Apr 19 '24 03:04 wayn

what?

Give more details, examples, and reproducible code demonstrating the problem, if it exists

mrT23 avatar Apr 20 '24 17:04 mrT23

ok, the code in the gitlab_provider.py in line 32 oauth_token is used for oauth token authentication private_token is used for personal access token

wayn avatar Apr 21 '24 13:04 wayn

Hi @wayn What's the use case to use personal access token with GitLab? Usually you won't want to reply to webhooks with a personal access token.

okotek avatar Apr 21 '24 13:04 okotek

Hi @okotek I see the code in project config settings use "PERSONAL_ACCESS_TOKEN". And if use oauth token may need to get access token dynamic but not define in the config file. I'm test set the "PERSONAL_ACCESS_TOKEN" in .secrets.toml config, and change the code oauth_token in gitlab_provider.py line 32 to private_token works well

wayn avatar Apr 22 '24 02:04 wayn

I mean, in hat scenario would you deploy pragent with a personal access token? Do you want to suggest a PR?

okotek avatar Apr 22 '24 20:04 okotek