GitLab API

GitlabTool

Actions1000

Overview

This node operation rotates an access token for a specific project in GitLab. It is useful for automating the process of renewing project access tokens to maintain security without manual intervention. For example, it can be used in CI/CD pipelines or administrative workflows to programmatically rotate tokens when they are about to expire or as part of a security policy.

Use Case Examples

  1. Rotate an access token for a GitLab project by specifying the project ID and token ID to ensure the token is refreshed regularly.
  2. Automate token rotation in a scheduled workflow to enhance project security.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request, useful for testing or when authentication is handled externally.
Authentication Specifies the authentication method to use, defaulting to GitLab API authentication.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method HTTP method to use for the request, defaulting to GET but can be set to POST, PUT, DELETE, HEAD, or PATCH.
Path Parameters Parameters to specify the project ID and token ID for the token to be rotated.

Output

JSON

  • id - The ID of the rotated access token.
  • name - The name of the rotated access token.
  • scopes - The scopes or permissions granted to the access token.
  • created_at - Timestamp when the access token was created.
  • expires_at - Expiration date of the access token.
  • token - The new token string after rotation.

Dependencies

  • GitLab API authentication

Troubleshooting

  • Ensure the project ID and token ID are correctly specified; incorrect IDs will cause the request to fail.
  • Verify that the authentication credentials are valid and have sufficient permissions to rotate access tokens.
  • Check the base URL if using a self-hosted GitLab instance to ensure it is correct.
  • Common error messages include 401 Unauthorized (authentication failure), 404 Not Found (invalid project or token ID), and 403 Forbidden (insufficient permissions). Resolving these involves correcting credentials, IDs, or permissions.

Links

Discussion