跳到內容
AggregaAggregaAggregaAggrega
選擇語言: 繁體中文
本頁為機器翻譯。閱讀英文原文。

aggrega auth

aggrega auth 將處理簽章身分的命令歸為一組——也就是無金鑰簽章所用的 OIDC 身分權杖。它有別於儲存登錄庫使用者名稱/密碼認證的 aggrega login:auth 關乎你簽章時的身分,login 關乎你如何連上登錄庫。

aggrega auth token

aggrega auth token 執行一次互動式 OIDC 流程,並將原始身分權杖印出到 stdout,讓你只需取得一次身分,就能在一批無金鑰簽章中重複使用,不必為每個成品各走一趟瀏覽器。

概要

aggrega auth token

運作方式

aggrega auth token 會開啟瀏覽器完成聯合 OIDC 登入(與 aggrega sign 和 aggrega push 在未提供權杖時使用的取得方式相同),然後將得到的身分權杖寫到 stdout 並結束。這個權杖就是無金鑰簽章向 Fulcio 申請憑證核發時所出示的值。

stdout 只會寫出權杖——後面接一個換行字元。任何提示或診斷都會輸出到 stderr,因此命令替換只會取得權杖本身:

export AGGREGA_IDENTITY_TOKEN=$(aggrega auth token)

匯出權杖之後,之後每一次無金鑰的 aggrega sign(或 aggrega push --sign)都會重複使用它,不再需要任何瀏覽器互動:

export AGGREGA_IDENTITY_TOKEN=$(aggrega auth token)
aggrega sign hub.example.com/component/core/api-server:1.0.0
aggrega sign hub.example.com/component/core/worker:1.0.0

這是互動式批次簽章的指令碼化對應做法:aggrega sign <ref1> <ref2> ... 會在處理程序內為整批作業一次取得身分,而 aggrega auth token 則將它匯出,供跨多次獨立叫用使用。

安全性

身分權杖的有效期很短,且此命令不會將它持久保存——將它印出到 stdout 是你自己的明確選擇,供你的終端機與匯出使用。它只存在於你放置它的地方(通常是在工作階段期間的 shell 環境變數中)。如果權杖在長批次完成之前過期,請重新執行 aggrega auth token 以取得新的權杖。

另請參閱

概要

aggrega auth

說明

Commands for the keyless signing identity (an OIDC identity token), distinct from `aggrega login`, which stores registry username/password credentials. The identity token is a short-lived secret used by keyless signing; it is never persisted by these commands.

子命令

命令說明
aggrega auth token以互動方式取得 OIDC 身分權杖並印出到 stdout

aggrega auth token 說明

Run the interactive OIDC flow once and print the raw identity token to stdout, so it can populate the environment for a batch of keyless signs:
export AGGREGA_IDENTITY_TOKEN=$(aggrega auth token)
Only the token is written to stdout; any prompt or diagnostic goes to stderr, so command substitution captures the token alone. The token is short-lived and is not persisted by this command — the caller decides whether to export it. This is distinct from `aggrega login`, which stores registry credentials.