Configuraciones de la organización
Usa la API de REST para gestionar las configuraciones de los registros privados para organizaciones.
List private registries for an organization
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.
Tokens de acceso específicos para "List private registries for an organization"
Este punto de conexión funciona con los siguientes tipos de token pormenorizados:
- Tokens de acceso de usuario de la aplicación de GitHub
- Token de acceso a la instalación de la aplicación de GitHub
- Tokens de acceso personal específico
El token pormenorizado debe tener el siguiente conjunto de permisos:
- "Organization private registries" organization permissions (read)
Parámetros para "List private registries for an organization"
| Nombre, Tipo, Descripción | 
|---|
| acceptstringSetting to  | 
| Nombre, Tipo, Descripción | 
|---|
| orgstring RequeridoThe organization name. The name is not case sensitive. | 
| Nombre, Tipo, Descripción | 
|---|
| per_pageintegerThe number of results per page (max 100). For more information, see "Using pagination in the REST API." Valor predeterminado:  | 
| pageintegerThe page number of the results to fetch. For more information, see "Using pagination in the REST API." Valor predeterminado:  | 
Códigos de estado de respuesta HTTP para "List private registries for an organization"
| status code | Descripción | 
|---|---|
| 200 | OK | 
| 400 | Bad Request | 
| 404 | Resource not found | 
Ejemplos de código para "List private registries for an organization"
Ejemplo de solicitud
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  http(s)://HOSTNAME/api/v3/orgs/ORG/private-registriesResponse
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
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.
Tokens de acceso específicos para "Create a private registry for an organization"
Este punto de conexión funciona con los siguientes tipos de token pormenorizados:
- Tokens de acceso de usuario de la aplicación de GitHub
- Token de acceso a la instalación de la aplicación de GitHub
- Tokens de acceso personal específico
El token pormenorizado debe tener el siguiente conjunto de permisos:
- "Organization private registries" organization permissions (write)
Parámetros para "Create a private registry for an organization"
| Nombre, Tipo, Descripción | 
|---|
| acceptstringSetting to  | 
| Nombre, Tipo, Descripción | 
|---|
| orgstring RequeridoThe organization name. The name is not case sensitive. | 
| Nombre, Tipo, Descripción | 
|---|
| registry_typestring RequeridoThe registry type. Puede ser uno de los siguientes:  | 
| urlstring RequeridoThe URL of the private registry. | 
| usernamestring or nullThe 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. | 
| replaces_basebooleanWhether this private registry should replace the base registry (e.g., npmjs.org for npm, rubygems.org for rubygems). When set to  Valor predeterminado:  | 
| encrypted_valuestring RequeridoThe value for your secret, encrypted with LibSodium using the public key retrieved from the Get private registries public key for an organization endpoint. | 
| key_idstring RequeridoThe ID of the key you used to encrypt the secret. | 
| visibilitystring RequeridoWhich type of organization repositories have access to the private registry.  Puede ser uno de los siguientes:  | 
| selected_repository_idsarray of integersAn array of repository IDs that can access the organization private registry. You can only provide a list of repository IDs when  | 
Códigos de estado de respuesta HTTP para "Create a private registry for an organization"
| status code | Descripción | 
|---|---|
| 201 | The organization private registry configuration | 
| 404 | Resource not found | 
| 422 | Validation failed, or the endpoint has been spammed. | 
Ejemplos de código para "Create a private registry for an organization"
Ejemplos de solicitud
curl -L \
  -X POST \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  http(s)://HOSTNAME/api/v3/orgs/ORG/private-registries \
  -d '{"registry_type":"maven_repository","url":"https://maven.pkg.github.com/organization/","username":"monalisa","replaces_base":true,"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
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.
Tokens de acceso específicos para "Get private registries public key for an organization"
Este punto de conexión funciona con los siguientes tipos de token pormenorizados:
- Tokens de acceso de usuario de la aplicación de GitHub
- Token de acceso a la instalación de la aplicación de GitHub
- Tokens de acceso personal específico
El token pormenorizado debe tener el siguiente conjunto de permisos:
- "Organization private registries" organization permissions (read)
Parámetros para "Get private registries public key for an organization"
| Nombre, Tipo, Descripción | 
|---|
| acceptstringSetting to  | 
| Nombre, Tipo, Descripción | 
|---|
| orgstring RequeridoThe organization name. The name is not case sensitive. | 
Códigos de estado de respuesta HTTP para "Get private registries public key for an organization"
| status code | Descripción | 
|---|---|
| 200 | OK | 
| 404 | Resource not found | 
Ejemplos de código para "Get private registries public key for an organization"
Ejemplo de solicitud
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  http(s)://HOSTNAME/api/v3/orgs/ORG/private-registries/public-keyResponse
Status: 200{
  "key_id": "012345678912345678",
  "key": "2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234"
}Get a private registry for an organization
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.
Tokens de acceso específicos para "Get a private registry for an organization"
Este punto de conexión funciona con los siguientes tipos de token pormenorizados:
- Tokens de acceso de usuario de la aplicación de GitHub
- Token de acceso a la instalación de la aplicación de GitHub
- Tokens de acceso personal específico
El token pormenorizado debe tener el siguiente conjunto de permisos:
- "Organization private registries" organization permissions (read)
Parámetros para "Get a private registry for an organization"
| Nombre, Tipo, Descripción | 
|---|
| acceptstringSetting to  | 
| Nombre, Tipo, Descripción | 
|---|
| orgstring RequeridoThe organization name. The name is not case sensitive. | 
| secret_namestring RequeridoThe name of the secret. | 
Códigos de estado de respuesta HTTP para "Get a private registry for an organization"
| status code | Descripción | 
|---|---|
| 200 | The specified private registry configuration for the organization | 
| 404 | Resource not found | 
Ejemplos de código para "Get a private registry for an organization"
Ejemplo de solicitud
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  http(s)://HOSTNAME/api/v3/orgs/ORG/private-registries/SECRET_NAMEThe 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
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.
Tokens de acceso específicos para "Update a private registry for an organization"
Este punto de conexión funciona con los siguientes tipos de token pormenorizados:
- Tokens de acceso de usuario de la aplicación de GitHub
- Token de acceso a la instalación de la aplicación de GitHub
- Tokens de acceso personal específico
El token pormenorizado debe tener el siguiente conjunto de permisos:
- "Organization private registries" organization permissions (write)
Parámetros para "Update a private registry for an organization"
| Nombre, Tipo, Descripción | 
|---|
| acceptstringSetting to  | 
| Nombre, Tipo, Descripción | 
|---|
| orgstring RequeridoThe organization name. The name is not case sensitive. | 
| secret_namestring RequeridoThe name of the secret. | 
| Nombre, Tipo, Descripción | 
|---|
| registry_typestringThe registry type. Puede ser uno de los siguientes:  | 
| urlstringThe URL of the private registry. | 
| usernamestring or nullThe 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. | 
| replaces_basebooleanWhether this private registry should replace the base registry (e.g., npmjs.org for npm, rubygems.org for rubygems). When set to  Valor predeterminado:  | 
| encrypted_valuestringThe value for your secret, encrypted with LibSodium using the public key retrieved from the Get private registries public key for an organization endpoint. | 
| key_idstringThe ID of the key you used to encrypt the secret. | 
| visibilitystringWhich type of organization repositories have access to the private registry.  Puede ser uno de los siguientes:  | 
| selected_repository_idsarray of integersAn array of repository IDs that can access the organization private registry. You can only provide a list of repository IDs when  | 
Códigos de estado de respuesta HTTP para "Update a private registry for an organization"
| status code | Descripción | 
|---|---|
| 204 | No Content | 
| 404 | Resource not found | 
| 422 | Validation failed, or the endpoint has been spammed. | 
Ejemplos de código para "Update a private registry for an organization"
Ejemplo de solicitud
curl -L \
  -X PATCH \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  http(s)://HOSTNAME/api/v3/orgs/ORG/private-registries/SECRET_NAME \
  -d '{"username":"monalisa","encrypted_value":"c2VjcmV0","key_id":"012345678912345678"}'Response
Status: 204Delete a private registry for an organization
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.
Tokens de acceso específicos para "Delete a private registry for an organization"
Este punto de conexión funciona con los siguientes tipos de token pormenorizados:
- Tokens de acceso de usuario de la aplicación de GitHub
- Token de acceso a la instalación de la aplicación de GitHub
- Tokens de acceso personal específico
El token pormenorizado debe tener el siguiente conjunto de permisos:
- "Organization private registries" organization permissions (write)
Parámetros para "Delete a private registry for an organization"
| Nombre, Tipo, Descripción | 
|---|
| acceptstringSetting to  | 
| Nombre, Tipo, Descripción | 
|---|
| orgstring RequeridoThe organization name. The name is not case sensitive. | 
| secret_namestring RequeridoThe name of the secret. | 
Códigos de estado de respuesta HTTP para "Delete a private registry for an organization"
| status code | Descripción | 
|---|---|
| 204 | No Content | 
| 400 | Bad Request | 
| 404 | Resource not found | 
Ejemplos de código para "Delete a private registry for an organization"
Ejemplo de solicitud
curl -L \
  -X DELETE \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  http(s)://HOSTNAME/api/v3/orgs/ORG/private-registries/SECRET_NAMEResponse
Status: 204