GitLab API

GitlabTool

Actions1000

Overview

This node operation allows rotating the personal access token for a specific project in GitLab via the API endpoint `/api/v4/projects/{id}/access_tokens/self/rotate`. It is useful for automating the renewal of access tokens to maintain security without manual intervention. For example, a user can schedule this node to run periodically to rotate tokens for continuous integration or deployment pipelines.

Use Case Examples

  1. Automate token rotation for a GitLab project to enhance security.
  2. Integrate token rotation in CI/CD workflows to avoid token expiration issues.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request, useful for testing or public endpoints.
Authentication Specifies the authentication method to use, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance, default is https://gitlab.com.
Method HTTP method to use for the request, default is GET but can be set to POST, PUT, DELETE, HEAD, or PATCH.
Path Parameters Parameters to be included in the request path, specifically the project ID under the name 'id'.

Output

JSON

  • id - The project ID for which the token is rotated.
  • access_token - The new personal access token generated after rotation.
  • expires_at - The expiration date of the new access token.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID is correctly provided in the path parameters to avoid 404 errors.
  • Verify that the API key used has sufficient permissions to rotate access tokens for the project.
  • If authentication is skipped, the request may fail due to lack of authorization.

Links

Discussion