GitLab API icon

GitLab API

Gitlab

Actions917

Overview

This node operation allows users to rotate their personal access token on GitLab via the API endpoint `/api/v4/personal_access_tokens/self/rotate`. It is useful for users who want to programmatically refresh their access tokens to maintain security without manual intervention. For example, a user can automate token rotation as part of a security policy or scheduled workflow.

Use Case Examples

  1. Automate personal access token rotation for GitLab to enhance security.
  2. Integrate token rotation into CI/CD pipelines to ensure tokens are regularly updated.

Properties

Name Meaning
Skip Authentication If set to true, the node will skip using authentication for the request.
Authentication Specifies the authentication method to use, defaulting to GitLab API authentication.
baseUrl The base URL of the GitLab instance to which the API request is sent, defaulting to https://gitlab.com.
Method The HTTP method used for the request, defaulting to GET but can be set to POST, PUT, DELETE, HEAD, or PATCH.
Parameter Schema Defines the schema for the parameters expected in the request body for the token rotation operation.
Request Body Schema Defines the schema for the request body, if applicable, for the token rotation operation.
Request Path The API endpoint path for rotating the personal access token, fixed to `/api/v4/personal_access_tokens/self/rotate`.

Output

JSON

  • token - The new personal access token returned after rotation.
  • expires_at - The expiration date of the new personal access token.
  • created_at - The creation date of the new personal access token.

Dependencies

  • GitLab API authentication credential

Troubleshooting

  • Ensure the GitLab API authentication credential is correctly configured and has the necessary permissions to rotate personal access tokens.
  • Verify the baseUrl is correctly set to the GitLab instance URL if using a self-hosted GitLab server.
  • Check that the HTTP method is set to POST for the token rotation operation, as other methods may not be supported for this endpoint.
  • Common error messages may include authentication failures or permission denied errors, which can be resolved by verifying API token scopes and credentials.

Links

Discussion