Buat Penerbit Federasi
Memerlukan token akses OAuth dengan scope org:admin, dari ant auth login --scope org:admin atau aturan workload identity federation; kunci Admin API tidak diterima. Lihat Mengelola WIF dengan Admin API.
Daftarkan penerbit OIDC yang akan dipercaya Anthropic untuk workload identity federation di organisasi Anda.
Field jwks mengontrol cara kunci penandatanganan penerbit diperoleh dan
menerima salah satu dari tiga bentuk yang dipilih oleh type: discovery (menyelesaikan kunci
melalui OIDC discovery), explicit_url (mengambil kunci dari URL JWKS
tetap), atau inline (menyediakan set kunci statis). Ketika jwks.type adalah
discovery dan tidak ada discovery_base yang ditetapkan, URL penerbit harus
dapat dijangkau secara publik melalui HTTPS agar Anthropic dapat mengambil dokumen
discovery; untuk mode explicit_url dan inline, URL penerbit hanya
dicocokkan sebagai klaim iss JWT dan tidak diambil.
Parameters
Returns
import os
from anthropic import Anthropic
client = Anthropic(
api_key=os.environ.get(
"ANTHROPIC_API_KEY"
), # This is the default and can be omitted
)
beta_federation_issuer = client.beta.organization.federation.issuers.create(
issuer_url="x",
name="x",
)
print(beta_federation_issuer.id){
"id": "fdis_01SDCCSbTxrXDpWc1phhtcfK",
"archived_at": "2019-12-27T18:11:19.117Z",
"archived_by_actor_id": "archived_by_actor_id",
"check_jti": true,
"created_at": "2024-10-30T23:58:27.427722Z",
"created_by_actor_id": "created_by_actor_id",
"issuer_url": "https://token.actions.githubusercontent.com",
"jwks": {
"type": "discovery",
"ca_cert_pem": "ca_cert_pem",
"discovery_base": "discovery_base"
},
"jwks_polling_disabled_at": "2019-12-27T18:11:19.117Z",
"max_jwt_lifetime_seconds": 0,
"name": "github-actions",
"poll_status": {
"consecutive_failures": 0,
"last_fetched_at": "2019-12-27T18:11:19.117Z",
"next_poll_at": "2019-12-27T18:11:19.117Z"
},
"type": "federation_issuer",
"updated_at": "2024-10-30T23:58:27.427722Z",
"updated_by_actor_id": "updated_by_actor_id"
}Returns Examples
{
"id": "fdis_01SDCCSbTxrXDpWc1phhtcfK",
"archived_at": "2019-12-27T18:11:19.117Z",
"archived_by_actor_id": "archived_by_actor_id",
"check_jti": true,
"created_at": "2024-10-30T23:58:27.427722Z",
"created_by_actor_id": "created_by_actor_id",
"issuer_url": "https://token.actions.githubusercontent.com",
"jwks": {
"type": "discovery",
"ca_cert_pem": "ca_cert_pem",
"discovery_base": "discovery_base"
},
"jwks_polling_disabled_at": "2019-12-27T18:11:19.117Z",
"max_jwt_lifetime_seconds": 0,
"name": "github-actions",
"poll_status": {
"consecutive_failures": 0,
"last_fetched_at": "2019-12-27T18:11:19.117Z",
"next_poll_at": "2019-12-27T18:11:19.117Z"
},
"type": "federation_issuer",
"updated_at": "2024-10-30T23:58:27.427722Z",
"updated_by_actor_id": "updated_by_actor_id"
}