GitLab API

GitlabTool

Actions1000

Overview

This node operation retrieves a specific GPG key of the authenticated user from the GitLab API using the key's ID. It is useful for scenarios where you need to access details about a particular GPG key associated with the user's GitLab account, such as verifying key information or managing user security settings.

Use Case Examples

  1. Fetch details of a user's GPG key by providing the key ID to verify its properties.
  2. Use the node to automate retrieval of GPG key information for audit or synchronization purposes.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request, useful for public or unauthenticated endpoints.
Authentication Specifies the authentication method to use, defaulting to GitLab API authentication.
baseUrl The base URL of the GitLab instance to which the request is sent, defaulting to https://gitlab.com.
Method HTTP method used for the request, defaulting to GET.
Path Parameters Parameters to be included in the request path, specifically the key_id which identifies the GPG key to retrieve.

Output

JSON

  • id - The unique identifier of the GPG key.
  • key - The actual GPG key string.
  • created_at - Timestamp when the GPG key was created.
  • expires_at - Timestamp when the GPG key expires, if applicable.
  • can_edit - Boolean indicating 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 credentials

Troubleshooting

  • Ensure the provided key_id path parameter is valid and corresponds to an existing GPG key for the authenticated user.
  • If authentication is skipped, verify that the GitLab instance allows unauthenticated access to this endpoint, otherwise authentication errors will occur.
  • Check the baseUrl to ensure it points to the correct GitLab instance, especially if using a self-hosted GitLab server.
  • Common error messages include 404 Not Found if the key_id does not exist or does not belong to the authenticated user, and 401 Unauthorized if authentication fails.

Links

Discussion