GitLab API

GitlabTool

Actions905

Overview

This node operation retrieves the GPG keys associated with the authenticated GitLab user via the GitLab API v4. It is useful for scenarios where you need to manage or verify the user's GPG keys programmatically, such as in automation workflows for security audits or user profile management.

Use Case Examples

  1. Fetch the current user's GPG keys to display or process them in a workflow.
  2. Automate the retrieval of GPG keys for verification before performing Git operations that require signed commits.

Properties

Name Meaning
Skip Authentication If set to true, the node will skip using authentication for the API request.
Authentication Specifies the authentication method to use, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance to which the API requests are sent, defaulting to https://gitlab.com.
Method The HTTP method used for the API request, defaulting to GET.
Query Parameters Optional query parameters to paginate the results, including 'page' for the current page number and 'per_page' for the number of items per page.

Output

JSON

  • id - The unique identifier of the GPG key.
  • key - The actual GPG public key string.
  • created_at - Timestamp when the GPG key was created.
  • expires_at - Timestamp when the GPG key expires, if applicable.
  • can_edit - Indicates if the GPG key can be edited by the user.
  • user_id - The ID of the user to whom the GPG key belongs.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the GitLab API key credential is correctly configured and has the necessary permissions to access user GPG keys.
  • If the API returns an authentication error, verify that 'Skip Authentication' is not enabled unless intentionally bypassing authentication.
  • Check the baseUrl property to ensure it points to the correct GitLab instance, especially if using a self-hosted GitLab server.
  • Pagination parameters 'page' and 'per_page' should be valid integers; invalid values may cause API errors.

Links

Discussion