ListSecrets
client.secrets.list(SecretListParams { token, pageSize, filter, pagination } params, RequestOptionsoptions?): SecretsPage<Secret { id, apiOnly, containerRegistryBasicAuthHost, 8 more } >
POST/gitpod.v1.SecretService/ListSecrets
Lists secrets
Use this method to:
- View all project secrets
- View all user secrets
Examples
-
List project secrets:
Shows all secrets for a project.
filter: scope: projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" pagination: pageSize: 20 -
List user secrets:
Shows all secrets for a user.
filter: scope: userId: "123e4567-e89b-12d3-a456-426614174000" pagination: pageSize: 20
ListSecrets
import Gitpod from '@gitpod/sdk';
const client = new Gitpod({
bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const secret of client.secrets.list({
filter: { scope: { projectId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047' } },
pagination: { pageSize: 20 },
})) {
console.log(secret.id);
}{
"pagination": {
"nextToken": "nextToken"
},
"secrets": [
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"apiOnly": true,
"containerRegistryBasicAuthHost": "https://example.com",
"createdAt": "2019-12-27T18:11:19.117Z",
"creator": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"principal": "PRINCIPAL_UNSPECIFIED"
},
"environmentVariable": true,
"filePath": "filePath",
"name": "name",
"projectId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"scope": {
"organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"projectId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"serviceAccountId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"userId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
},
"updatedAt": "2019-12-27T18:11:19.117Z"
}
]
}Returns Examples
{
"pagination": {
"nextToken": "nextToken"
},
"secrets": [
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"apiOnly": true,
"containerRegistryBasicAuthHost": "https://example.com",
"createdAt": "2019-12-27T18:11:19.117Z",
"creator": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"principal": "PRINCIPAL_UNSPECIFIED"
},
"environmentVariable": true,
"filePath": "filePath",
"name": "name",
"projectId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"scope": {
"organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"projectId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"serviceAccountId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"userId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
},
"updatedAt": "2019-12-27T18:11:19.117Z"
}
]
}