Aller au contenu principal

Renouveler un identifiant d'accès au dépôt

POST /api/v1/repository-connections/{id}/credential

Nécessite la révision actuelle. Remplace le texte chiffré stocké sans conserver l'ancien jeton dans l'historique des révisions. Révoquez séparément les anciens jetons auprès du fournisseur.

Rôles autorisés : admin.

Authentification​

Les alternatives OpenAPI suivantes décrivent les méthodes d'authentification acceptées. Les modifications depuis le navigateur nécessitent également l'en-tête Origin canonique.

[
{
"organizationCredential": []
},
{
"browserSession": []
}
]

Paramètres​

[
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
]

Corps de la requête​

{
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"expectedRevision": {
"type": "integer"
},
"credential": {
"type": "object",
"properties": {
"token": {
"type": "string",
"minLength": 16,
"maxLength": 8192,
"writeOnly": true
},
"expiresAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"token"
],
"additionalProperties": false
}
},
"required": [
"expectedRevision",
"credential"
]
}
}
}
}

Réponses​

{
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RepositoryConnection"
}
}
}
},
"400": {
"description": "Validation error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Missing/expired/revoked credential",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "Insufficient role",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"409": {
"description": "State or idempotency conflict",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"413": {
"description": "Body too large",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"415": {
"description": "Unsupported media type",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "Request budget exhausted; respect Retry-After",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
},
"headers": {
"Retry-After": {
"schema": {
"type": "integer",
"minimum": 1
},
"description": "Seconds until sufficient budget is expected; concurrent traffic may consume replenished capacity."
}
}
},
"500": {
"description": "Internal error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"503": {
"description": "Not configured",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}

Les références telles que #/components/schemas/Asset sont résolues dans les schémas partagés. Téléchargez le contrat OpenAPI pour générer des clients. Cette page est générée ; elle décrit l'API de développement implémentée, et non des points de terminaison prévus.