無効化
GitHub またはその他の場所で露出していることがわかった資格情報を、REST API を使って取り消します。
Revoke a list of credentials
Submit a list of credentials to be revoked. This endpoint is intended to revoke credentials the caller does not own and may have found exposed on GitHub.com or elsewhere. Credential owners will be notified of the revocation.
This endpoint currently accepts the following credential types:
- Personal access tokens (classic) (
ghp_) - Fine-grained personal access tokens (
github_pat_)
To prevent abuse, this API is limited to 60 authenticated requests per hour and a max of 1000 tokens per API request.
"Revoke a list of credentials" のきめ細かいアクセス トークン
このエンドポイントは、GitHub アプリのユーザー アクセス トークン、GitHub アプリのインストール アクセス トークン、またはきめ細かい個人用アクセス トークンでは機能しません。
"Revoke a list of credentials" のパラメーター
| 名前, タイプ, 説明 |
|---|
accept string Setting to |
| 名前, タイプ, 説明 |
|---|
credentials array of strings 必須A list of credentials to be revoked, up to 1000 per request. |
"Revoke a list of credentials" の HTTP 応答状態コード
| 状態コード | 説明 |
|---|---|
202 | Accepted |
422 | Validation failed, or the endpoint has been spammed. |
500 | Internal Error |
"Revoke a list of credentials" のコード サンプル
要求の例
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/credentials/revoke \
-d '{"credentials":["ghp_1234567890abcdef1234567890abcdef12345678","github_pat_0A1B2C3D4E5F6G7H8I9J0K_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456","gho_1234567890abcdef1234567890abcdef12345678","ghu_1234567890abcdef1234567890abcdef12345678","ghr_1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890ab"]}'Accepted
Status: 202