GitLab API

GitlabTool

Actions905

Overview

This node interacts with the GitLab API to manage user GPG keys, specifically supporting the operation to add a new GPG key for the authenticated user via a POST request to the /api/v4/user/gpg_keys endpoint. It is useful for automating the management of GPG keys in GitLab, such as adding new keys programmatically as part of a CI/CD pipeline or user management workflow.

Use Case Examples

  1. Automatically add a new GPG key for a user when onboarding new developers.
  2. Integrate with a security system to update GPG keys in GitLab based on external key management policies.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request, useful for public or unauthenticated endpoints.
Authentication Selects the authentication method, 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 HTTP method to use for the API request, defaulting to GET but supporting POST, PUT, DELETE, HEAD, and PATCH.
Parameter Schema Defines the schema for the parameters expected in the request body for the postApiV4UserGpgKeys operation, required for the POST request to add a GPG key.
Request Body Schema Schema for the request body content, used to validate the data sent when adding a new GPG key.
Request Path The API endpoint path for adding a user GPG key, fixed to /api/v4/user/gpg_keys.

Output

JSON

  • id - The unique identifier of the newly added GPG key.
  • key - The GPG key content that was added.
  • 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.

Dependencies

  • Requires GitLab API key credential for authentication.

Troubleshooting

  • Authentication errors if the API key is missing or invalid. Ensure the GitLab API key credential is correctly configured.
  • Validation errors if the request body does not conform to the expected schema for adding a GPG key. Verify the request body matches the required schema.
  • Network or connectivity issues if the baseUrl is incorrect or the GitLab instance is unreachable.

Links

Discussion