Skip to main content
Die REST-API verfügt jetzt über eine Versionskontrolle. Weitere Informationen findest du unter Informationen zur API-Versionsverwaltung.

Organisationskonfigurationen

Verwende die REST-API, um private Registrierungskonfigurationen für Organisationen zu verwalten.

Note

Die Möglichkeit, private Registrierungen mithilfe der REST-API zu verwalten, befindet sich derzeit in public preview. Änderungen sind vorbehalten.

List private registries for an organization

Note

This endpoint is in public preview and is subject to change.

Lists all private registry configurations available at the organization-level without revealing their encrypted values.

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

Differenzierte Zugriffstoken für "List private registries for an organization"

Dieser Endpunkt funktioniert mit den folgenden differenzierten Tokentypen.:

Das differenzierte Token muss einen der folgenden Berechtigungssätze aufweisen.:

  • "Organization private registries" organization permissions (read)

Parameter für „List private registries for an organization“

Header
Name, type, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, type, BESCHREIBUNG
org string Erforderlich

The organization name. The name is not case sensitive.

Abfrageparameter
Name, type, BESCHREIBUNG
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

Standard: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

Standard: 1

HTTP-Antwortstatuscodes für „List private registries for an organization“

StatuscodeBESCHREIBUNG
200

OK

400

Bad Request

404

Resource not found

Codebeispiele für „List private registries for an organization“

Anforderungsbeispiel

get/orgs/{org}/private-registries
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/private-registries

Response

Status: 200
{ "total_count": 1, "configurations": [ { "name": "MAVEN_REPOSITORY_SECRET", "registry_type": "maven_repository", "username": "monalisa", "created_at": "2019-08-10T14:59:22Z", "updated_at": "2020-01-10T14:59:22Z", "visibility": "selected" } ] }

Create a private registry for an organization

Note

This endpoint is in public preview and is subject to change.

Creates a private registry configuration with an encrypted value for an organization. Encrypt your secret using LibSodium. For more information, see "Encrypting secrets for the REST API."

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

Differenzierte Zugriffstoken für "Create a private registry for an organization"

Dieser Endpunkt funktioniert mit den folgenden differenzierten Tokentypen.:

Das differenzierte Token muss einen der folgenden Berechtigungssätze aufweisen.:

  • "Organization private registries" organization permissions (write)

Parameter für „Create a private registry for an organization“

Header
Name, type, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, type, BESCHREIBUNG
org string Erforderlich

The organization name. The name is not case sensitive.

Textparameter
Name, type, BESCHREIBUNG
registry_type string Erforderlich

The registry type.

Wert: maven_repository

username string or null

The username to use when authenticating with the private registry. This field should be omitted if the private registry does not require a username for authentication.

encrypted_value string Erforderlich

The value for your secret, encrypted with LibSodium using the public key retrieved from the Get private registries public key for an organization endpoint.

key_id string Erforderlich

The ID of the key you used to encrypt the secret.

visibility string Erforderlich

Which type of organization repositories have access to the private registry. selected means only the repositories specified by selected_repository_ids can access the private registry.

Kann eine der Folgenden sein: all, private, selected

selected_repository_ids array of integers

An array of repository IDs that can access the organization private registry. You can only provide a list of repository IDs when visibility is set to selected. You can manage the list of selected repositories using the Update a private registry for an organization endpoint. This field should be omitted if visibility is set to all or private.

HTTP-Antwortstatuscodes für „Create a private registry for an organization“

StatuscodeBESCHREIBUNG
201

The organization private registry configuration

404

Resource not found

422

Validation failed, or the endpoint has been spammed.

Codebeispiele für „Create a private registry for an organization“

Beispiele für Anforderungen

post/orgs/{org}/private-registries
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/private-registries \ -d '{"registry_type":"maven_repository","username":"monalisa","encrypted_value":"c2VjcmV0","key_id":"012345678912345678","visibility":"private"}'

The organization private registry configuration

Status: 201
{ "name": "MAVEN_REPOSITORY_SECRET", "registry_type": "maven_repository", "username": "monalisa", "visibility": "selected", "selected_repository_ids": [ 1296269, 1296280 ], "created_at": "2019-08-10T14:59:22Z", "updated_at": "2020-01-10T14:59:22Z" }

Get private registries public key for an organization

Note

This endpoint is in public preview and is subject to change.

Gets the org public key, which is needed to encrypt private registry secrets. You need to encrypt a secret before you can create or update secrets.

OAuth tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

Differenzierte Zugriffstoken für "Get private registries public key for an organization"

Dieser Endpunkt funktioniert mit den folgenden differenzierten Tokentypen.:

Das differenzierte Token muss einen der folgenden Berechtigungssätze aufweisen.:

  • "Organization private registries" organization permissions (read)

Parameter für „Get private registries public key for an organization“

Header
Name, type, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, type, BESCHREIBUNG
org string Erforderlich

The organization name. The name is not case sensitive.

HTTP-Antwortstatuscodes für „Get private registries public key for an organization“

StatuscodeBESCHREIBUNG
200

OK

404

Resource not found

Codebeispiele für „Get private registries public key for an organization“

Anforderungsbeispiel

get/orgs/{org}/private-registries/public-key
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/private-registries/public-key

Response

Status: 200
{ "key_id": "012345678912345678", "key": "2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234" }

Get a private registry for an organization

Note

This endpoint is in public preview and is subject to change.

Get the configuration of a single private registry defined for an organization, omitting its encrypted value.

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

Differenzierte Zugriffstoken für "Get a private registry for an organization"

Dieser Endpunkt funktioniert mit den folgenden differenzierten Tokentypen.:

Das differenzierte Token muss einen der folgenden Berechtigungssätze aufweisen.:

  • "Organization private registries" organization permissions (read)

Parameter für „Get a private registry for an organization“

Header
Name, type, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, type, BESCHREIBUNG
org string Erforderlich

The organization name. The name is not case sensitive.

secret_name string Erforderlich

The name of the secret.

HTTP-Antwortstatuscodes für „Get a private registry for an organization“

StatuscodeBESCHREIBUNG
200

The specified private registry configuration for the organization

404

Resource not found

Codebeispiele für „Get a private registry for an organization“

Anforderungsbeispiel

get/orgs/{org}/private-registries/{secret_name}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/private-registries/SECRET_NAME

The specified private registry configuration for the organization

Status: 200
{ "name": "MAVEN_REPOSITORY_SECRET", "registry_type": "maven_repository", "username": "monalisa", "visibility": "private", "created_at": "2019-08-10T14:59:22Z", "updated_at": "2020-01-10T14:59:22Z" }

Update a private registry for an organization

Note

This endpoint is in public preview and is subject to change.

Updates a private registry configuration with an encrypted value for an organization. Encrypt your secret using LibSodium. For more information, see "Encrypting secrets for the REST API."

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

Differenzierte Zugriffstoken für "Update a private registry for an organization"

Dieser Endpunkt funktioniert mit den folgenden differenzierten Tokentypen.:

Das differenzierte Token muss einen der folgenden Berechtigungssätze aufweisen.:

  • "Organization private registries" organization permissions (write)

Parameter für „Update a private registry for an organization“

Header
Name, type, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, type, BESCHREIBUNG
org string Erforderlich

The organization name. The name is not case sensitive.

secret_name string Erforderlich

The name of the secret.

Textparameter
Name, type, BESCHREIBUNG
registry_type string

The registry type.

Wert: maven_repository

username string or null

The username to use when authenticating with the private registry. This field should be omitted if the private registry does not require a username for authentication.

encrypted_value string

The value for your secret, encrypted with LibSodium using the public key retrieved from the Get private registries public key for an organization endpoint.

key_id string

The ID of the key you used to encrypt the secret.

visibility string

Which type of organization repositories have access to the private registry. selected means only the repositories specified by selected_repository_ids can access the private registry.

Kann eine der Folgenden sein: all, private, selected

selected_repository_ids array of integers

An array of repository IDs that can access the organization private registry. You can only provide a list of repository IDs when visibility is set to selected. This field should be omitted if visibility is set to all or private.

HTTP-Antwortstatuscodes für „Update a private registry for an organization“

StatuscodeBESCHREIBUNG
204

No Content

404

Resource not found

422

Validation failed, or the endpoint has been spammed.

Codebeispiele für „Update a private registry for an organization“

Anforderungsbeispiel

patch/orgs/{org}/private-registries/{secret_name}
curl -L \ -X PATCH \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/private-registries/SECRET_NAME \ -d '{"username":"monalisa","encrypted_value":"c2VjcmV0","key_id":"012345678912345678"}'

Response

Status: 204

Delete a private registry for an organization

Note

This endpoint is in public preview and is subject to change.

Delete a private registry configuration at the organization-level.

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

Differenzierte Zugriffstoken für "Delete a private registry for an organization"

Dieser Endpunkt funktioniert mit den folgenden differenzierten Tokentypen.:

Das differenzierte Token muss einen der folgenden Berechtigungssätze aufweisen.:

  • "Organization private registries" organization permissions (write)

Parameter für „Delete a private registry for an organization“

Header
Name, type, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, type, BESCHREIBUNG
org string Erforderlich

The organization name. The name is not case sensitive.

secret_name string Erforderlich

The name of the secret.

HTTP-Antwortstatuscodes für „Delete a private registry for an organization“

StatuscodeBESCHREIBUNG
204

No Content

400

Bad Request

404

Resource not found

Codebeispiele für „Delete a private registry for an organization“

Anforderungsbeispiel

delete/orgs/{org}/private-registries/{secret_name}
curl -L \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/private-registries/SECRET_NAME

Response

Status: 204