GitLab API icon

GitLab API

Gitlab

Actions917

Overview

This node interacts with the GitLab API to add a GPG key to a specified user by their user ID. It is useful for automating user management tasks in GitLab, such as programmatically adding GPG keys for users to enhance security and verify commits. For example, an admin can use this node to add GPG keys to multiple users in bulk.

Use Case Examples

  1. Adding a GPG key to a user by specifying their user ID and the key details in the request body.
  2. Automating user security setup by integrating this node in a workflow that manages GitLab user profiles.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request.
Authentication Type of authentication used for the request, default is GitLab API key.
baseUrl Base URL of the GitLab instance, default is https://gitlab.com.
Method HTTP method to use for the request, default is GET.
Parameter Schema Schema defining the parameters for the operation postApiV4UsersIdGpgKeys, including path and body parameters.
Request Body Schema Schema defining the structure of the request body for the operation postApiV4UsersIdGpgKeys.
Request Path API endpoint path for adding a GPG key to a user, with user ID as a path parameter.
Path Parameters Collection of path parameters, specifically the user ID to identify the user to whom the GPG key will be added.

Output

JSON

  • id - The ID of the newly added 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 - ID of the user to whom the GPG key belongs.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the user ID provided in the path parameters is valid and exists in GitLab.
  • Verify that the request body contains a valid GPG key according to GitLab API specifications.
  • Check that the GitLab API key credential has sufficient permissions to add GPG keys to users.
  • Common error messages include authentication failures, invalid user ID, or malformed GPG key data. Resolving these involves verifying credentials, user existence, and request body format.

Links

Discussion