GitLab API icon

GitLab API

Gitlab

Actions917

Overview

This node interacts with the GitLab API to create a new GPG key for the authenticated user. It is useful for automating the management of GPG keys in GitLab, such as adding new keys for commit signing or verification purposes. For example, a developer can use this node to programmatically add a GPG key to their GitLab profile as part of a CI/CD pipeline or user setup process.

Use Case Examples

  1. Automate adding a GPG key to a GitLab user profile during onboarding.
  2. Integrate GPG key management into a DevOps workflow to ensure all commits are signed.

Properties

Name Meaning
Skip Authentication Determines whether to skip authentication for the request.
Authentication Specifies the authentication method to use, defaulting to GitLab API key.
baseUrl The base URL of the GitLab instance to which the request is sent.
Method HTTP method to use for the request, default is GET but POST is used for this operation.
Parameter Schema Defines the schema for the parameters sent in the request body for the postApiV4UserGpgKeys operation.
Request Body Schema Schema for the request body content for the postApiV4UserGpgKeys operation.
Request Path The API endpoint path for creating a user GPG key, fixed to /api/v4/user/gpg_keys.

Output

JSON

  • id - The unique identifier of the created GPG key.
  • key - The GPG key content.
  • created_at - Timestamp when the GPG key was created.
  • expires_at - Expiration date of the GPG key, if any.
  • can_edit - Indicates if the GPG key can be edited.
  • user_id - The ID of the user to whom the GPG key belongs.

Dependencies

  • An API key credential for GitLab authentication.

Troubleshooting

  • Ensure the API key has sufficient permissions to create GPG keys for the user.
  • Verify the baseUrl is correct and accessible.
  • Check that the request body conforms to the expected schema for creating GPG keys.
  • Common error: 401 Unauthorized - indicates authentication failure; verify API key and authentication settings.
  • Common error: 400 Bad Request - indicates invalid input data; check the request body for required fields and correct format.

Links

Discussion