Reference
GitLab
Connect GitLab to Alter Vault for secure API access
Overview
Section titled “Overview”Use GitLab credentials to make authenticated API calls through Alter Vault without exposing API keys in code.
| Property | Value |
|---|---|
| Provider ID | gitlab |
| Category | Developer Tools |
| Credential Type | API Key |
Step 1: Get Credentials
Section titled “Step 1: Get Credentials”Log in to GitLab
Log in to GitLab at gitlab.com.
Go to User Settings → Access Tokens
Go to User Settings → Access Tokens at gitlab.com/-/user_settings/personal_access_tokens.
Generate a token
From the Generate token dropdown choose Legacy token (classic scopes across all your groups and projects) or Fine-grained token (limited to the groups, projects and permissions you pick), then set the name, expiration, and scopes.
Copy your token
Copy the generated token.
Enter hostname if self-hosted
If using a self-hosted instance, enter the hostname in the GitLab Hostname field.
Step 2: Add to Alter Vault
Section titled “Step 2: Add to Alter Vault”Open the Developer Portal
Go to portal.alterauth.com and navigate to the application.
Add GitLab
Go to Managed Secrets > Add Provider > GitLab.
Enter credentials
Paste your Personal Access Token into the credential field. If using a self-hosted instance, also enter your GitLab hostname in the GitLab Hostname field.
Save
Click Save. You’ll receive a grant_id to use with the SDK.
Using in Code
Section titled “Using in Code”response = await alter_app.request( HttpMethod.GET, "https://YOUR_GITLAB_HOST/api/v4/projects", grant_id="YOUR_GRANT_ID", # Use gitlab.com for cloud or your self-hosted hostname)Policy-cataloged operations
Section titled “Policy-cataloged operations”Alter policy rules can target these attested operations and families for operation-level and parameter-aware controls.
Rules saved with the former V3-prefixed operation IDs continue to match as
compatibility aliases. New rules and audit filters should use the canonical
GitLab ApiV4 IDs below.
| Operation ID | Families | Method | Provider path | Notes |
|---|---|---|---|---|
getApiV4Projects | read | GET | /api/v4/projects | also accepts getV3Projects |
getApiV4ProjectsId | read | GET | /api/v4/projects/{id} | also accepts getV3ProjectsId |
postApiV4Projects | write | POST | /api/v4/projects | also accepts postV3Projects |
putApiV4ProjectsId | admin | PUT | /api/v4/projects/{id} | also accepts putV3ProjectsId |
deleteApiV4ProjectsId | delete | DELETE | /api/v4/projects/{id} | also accepts deleteV3ProjectsId |
getApiV4Issues | read | GET | /api/v4/issues | also accepts getV3Issues |
getApiV4ProjectsIdIssues | read | GET | /api/v4/projects/{id}/issues | also accepts getV3ProjectsIdIssues |
getApiV4ProjectsIdIssuesIssueIid | read | GET | /api/v4/projects/{id}/issues/{issue_iid} | also accepts getV3ProjectsIdIssuesIssueId |
postApiV4ProjectsIdIssues | write | POST | /api/v4/projects/{id}/issues | also accepts postV3ProjectsIdIssues |
putApiV4ProjectsIdIssuesIssueIid | write | PUT | /api/v4/projects/{id}/issues/{issue_iid} | also accepts putV3ProjectsIdIssuesIssueId |
deleteApiV4ProjectsIdIssuesIssueIid | delete | DELETE | /api/v4/projects/{id}/issues/{issue_iid} | also accepts deleteV3ProjectsIdIssuesIssueId |
postApiV4ProjectsIdIssuesIssueIidNotes | write | POST | /api/v4/projects/{id}/issues/{issue_iid}/notes | also accepts postApiV4ProjectsIdIssuesNoteableIdNotes, postV3ProjectsIdIssuesNoteableIdNotes |
getApiV4ProjectsIdMergeRequests | read | GET | /api/v4/projects/{id}/merge_requests | also accepts getV3ProjectsIdMergeRequests |
getApiV4ProjectsIdMergeRequestsMergeRequestIid | read | GET | /api/v4/projects/{id}/merge_requests/{merge_request_iid} | also accepts getV3ProjectsIdMergeRequestsMergeRequestId |
getApiV4ProjectsIdMergeRequestsMergeRequestIidChanges | read | GET | /api/v4/projects/{id}/merge_requests/{merge_request_iid}/changes | also accepts getV3ProjectsIdMergeRequestsMergeRequestIdChanges |
postApiV4ProjectsIdMergeRequests | write | POST | /api/v4/projects/{id}/merge_requests | also accepts postV3ProjectsIdMergeRequests |
putApiV4ProjectsIdMergeRequestsMergeRequestIid | write | PUT | /api/v4/projects/{id}/merge_requests/{merge_request_iid} | also accepts putV3ProjectsIdMergeRequestsMergeRequestId |
putApiV4ProjectsIdMergeRequestsMergeRequestIidMerge | write | PUT | /api/v4/projects/{id}/merge_requests/{merge_request_iid}/merge | also accepts putV3ProjectsIdMergeRequestsMergeRequestIdMerge |
postApiV4ProjectsIdMergeRequestsMergeRequestIidNotes | write | POST | /api/v4/projects/{id}/merge_requests/{merge_request_iid}/notes | also accepts postApiV4ProjectsIdMergeRequestsNoteableIdNotes, postV3ProjectsIdMergeRequestsNoteableIdNotes |
getApiV4ProjectsIdRepositoryBranches | read | GET | /api/v4/projects/{id}/repository/branches | also accepts getV3ProjectsIdRepositoryBranches |
postApiV4ProjectsIdRepositoryBranches | write | POST | /api/v4/projects/{id}/repository/branches | also accepts postV3ProjectsIdRepositoryBranches |
deleteApiV4ProjectsIdRepositoryBranchesBranch | delete | DELETE | /api/v4/projects/{id}/repository/branches/{branch} | also accepts deleteV3ProjectsIdRepositoryBranchesBranch |
getApiV4ProjectsIdRepositoryCommits | read | GET | /api/v4/projects/{id}/repository/commits | also accepts getV3ProjectsIdRepositoryCommits |
getApiV4ProjectsIdRepositoryCommitsSha | read | GET | /api/v4/projects/{id}/repository/commits/{sha} | also accepts getV3ProjectsIdRepositoryCommitsSha |
postApiV4ProjectsIdRepositoryCommits | delete, write | POST | /api/v4/projects/{id}/repository/commits | also accepts postV3ProjectsIdRepositoryCommits |
getApiV4ProjectsIdRepositoryFilesFilePath | read | GET | /api/v4/projects/{id}/repository/files/{+file_path} | also accepts getV3ProjectsIdRepositoryFiles |
getApiV4ProjectsIdRepositoryFilesFilePathRaw | read | GET | /api/v4/projects/{id}/repository/files/{+file_path}/raw | — |
getApiV4ProjectsIdRepositoryFilesFilePathBlame | read | GET | /api/v4/projects/{id}/repository/files/{+file_path}/blame | — |
postApiV4ProjectsIdRepositoryFilesFilePath | write | POST | /api/v4/projects/{id}/repository/files/{+file_path} | also accepts postV3ProjectsIdRepositoryFiles |
putApiV4ProjectsIdRepositoryFilesFilePath | write | PUT | /api/v4/projects/{id}/repository/files/{+file_path} | also accepts putV3ProjectsIdRepositoryFiles |
deleteApiV4ProjectsIdRepositoryFilesFilePath | delete | DELETE | /api/v4/projects/{id}/repository/files/{+file_path} | also accepts deleteV3ProjectsIdRepositoryFiles |
getApiV4ProjectsIdPipelines | read | GET | /api/v4/projects/{id}/pipelines | also accepts getV3ProjectsIdPipelines |
getApiV4ProjectsIdPipelinesPipelineId | read | GET | /api/v4/projects/{id}/pipelines/{pipeline_id} | also accepts getV3ProjectsIdPipelinesPipelineId |
getApiV4ProjectsIdMembers | read | GET | /api/v4/projects/{id}/members | also accepts getV3ProjectsIdMembers |
postApiV4ProjectsIdMembers | admin | POST | /api/v4/projects/{id}/members | also accepts postV3ProjectsIdMembers |
putApiV4ProjectsIdMembersUserId | admin | PUT | /api/v4/projects/{id}/members/{user_id} | also accepts putV3ProjectsIdMembersUserId |
deleteApiV4ProjectsIdMembersUserId | admin | DELETE | /api/v4/projects/{id}/members/{user_id} | also accepts deleteV3ProjectsIdMembersUserId |
getApiV4ProjectsIdHooks | read | GET | /api/v4/projects/{id}/hooks | also accepts getV3ProjectsIdHooks |
postApiV4ProjectsIdHooks | admin | POST | /api/v4/projects/{id}/hooks | also accepts postV3ProjectsIdHooks |
deleteApiV4ProjectsIdHooksHookId | admin, delete | DELETE | /api/v4/projects/{id}/hooks/{hook_id} | also accepts deleteV3ProjectsIdHooksHookId |
getApiV4Groups | read | GET | /api/v4/groups | also accepts getV3Groups |
getApiV4GroupsId | read | GET | /api/v4/groups/{id} | also accepts getV3GroupsId |
getApiV4User | read | GET | /api/v4/user | also accepts getV3User |