Title: Rotate project access token with custom expires_at · python-gitlab/python-gitlab · Discussion #3028 · GitHub
Open Graph Title: Rotate project access token with custom expires_at · python-gitlab/python-gitlab · Discussion #3028
X Title: Rotate project access token with custom expires_at · python-gitlab/python-gitlab · Discussion #3028
Description: Rotate project access token with custom expires_at
Open Graph Description: Hi, I wanna rotate a project access token but with a custom expires_at. But I'm not sure how to do in python-gitlab. The example docs don't give any examples and the reference documentation is a bi...
X Description: Hi, I wanna rotate a project access token but with a custom expires_at. But I'm not sure how to do in python-gitlab. The example docs don't give any examples and the reference documentation...
Opengraph URL: https://github.com/python-gitlab/python-gitlab/discussions/3028
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"QAPage","mainEntity":{"@type":"Question","name":"Rotate project access token with custom expires_at","text":"Hi,
\nI wanna rotate a project access token but with a custom expires_at.
\nBut I'm not sure how to do in python-gitlab. The example docs don't give any examples and the reference documentation is a bit confusing for me.
\nI tried following:
\n>>> type(token) # for reference\n<class 'gitlab.v4.objects.project_access_tokens.ProjectAccessToken'>\n>>> token.rotate({\"expires_at\":\"2024-12-12\"})\nTraceback (most recent call last):\n File \"<pyshell#41>\", line 1, in <module>\n token.rotate({\"expires_at\":\"2024-12-12\"})\nTypeError: ObjectRotateMixin.rotate() takes 1 positional argument but 2 were given
\nMaybe someone can help me out here?
","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"@botkero this should already work with token.rotate(expires_at=\"2024-12-12\"). Please let us know if not!
\nSee source:
\n
\n \n \n python-gitlab/gitlab/mixins.py\n
\n \n Line 668\n in\n 541a7e3\n
\n \n \n \n\n \n \n self, id: Union[str, int], expires_at: Optional[str] = None, **kwargs: Any \n \n
\n \n\n","upvoteCount":2,"url":"https://github.com/python-gitlab/python-gitlab/discussions/3028#discussioncomment-11101617"}}}
| route-pattern | /:user_id/:repository/discussions/:number(.:format) |
| route-controller | discussions |
| route-action | show |
| fetch-nonce | v2:22c03632-77e2-7611-44a9-90d1a96162c5 |
| current-catalog-service-hash | 9f0abe34da433c9b6db74bffa2466494a717b579a96b30a5d252e5090baea7be |
| request-id | C98A:3EFF91:C913A1:109C5CB:6971709B |
| html-safe-nonce | e0da72a17d6c740f4955e27c563043cfe49085b0b7be9da22668ccb17684cd46 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOThBOjNFRkY5MTpDOTEzQTE6MTA5QzVDQjo2OTcxNzA5QiIsInZpc2l0b3JfaWQiOiIzMjM4NDI1NTcyMjQ5MDA2MjM1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | be04faf00ab7d1eb273b6b50ed972ad793741eb1bc4ceb68356902eb30df3998 |
| hovercard-subject-tag | discussion:7396543 |
| github-keyboard-shortcuts | repository,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python-gitlab/python-gitlab/discussions/3028 |
| twitter:image | https://opengraph.githubassets.com/0b59ea4299f65b677ccbf396de36bab4b567479e641332be9a327a9655e43224/python-gitlab/python-gitlab/discussions/3028 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0b59ea4299f65b677ccbf396de36bab4b567479e641332be9a327a9655e43224/python-gitlab/python-gitlab/discussions/3028 |
| og:image:alt | Hi, I wanna rotate a project access token but with a custom expires_at. But I'm not sure how to do in python-gitlab. The example docs don't give any examples and the reference documentation is a bi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 353479110ec1e87d687013548f216c852055ec907d09d2fb6a180cb5ed9d28e1 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-gitlab/python-gitlab git https://github.com/python-gitlab/python-gitlab.git |
| octolytics-dimension-user_id | 28886265 |
| octolytics-dimension-user_login | python-gitlab |
| octolytics-dimension-repository_id | 8077625 |
| octolytics-dimension-repository_nwo | python-gitlab/python-gitlab |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 8077625 |
| octolytics-dimension-repository_network_root_nwo | python-gitlab/python-gitlab |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | a4c7e274c03a115b82dcef6c47ce3f7f903e88e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width