GitLab API

GitlabTool

Actions1000

Overview

This node operation retrieves a specific GPG key of a user from the GitLab API. It is useful for scenarios where you need to access detailed information about a user's GPG key, such as verifying the key's validity or managing user security settings. For example, an administrator might use this to audit user keys or a developer might fetch key details for integration purposes.

Use Case Examples

  1. Fetch the GPG key details of a user by providing the user ID and the GPG key ID.
  2. Use the node to verify a user's GPG key before allowing code commits or merges.

Properties

Name Meaning
Skip Authentication Determines whether to skip the authentication process 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 request is sent.
Method The HTTP method used for the API request, defaulting to GET.
Path Parameters The path parameters required for the API endpoint, specifically the user ID and the GPG key ID to identify the resource.

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_encrypt - Indicates if the key can be used for encryption.
  • can_sign - Indicates if the key can be used for signing.
  • can_certify - Indicates if the key can be used for certification.
  • can_authenticate - Indicates if the key can be used for authentication.

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the user ID and GPG key ID are correctly provided and exist in the GitLab instance.
  • Verify that the API key used for authentication has sufficient permissions to access user GPG keys.
  • Check the base URL to confirm it points to the correct GitLab instance.
  • Common error messages include 404 Not Found if the user or key does not exist, and 401 Unauthorized if authentication fails. Resolving these involves verifying IDs and authentication credentials.

Links

Discussion