NOISSUE - Add FetchKbsToken RPC support, update protobuf generation, and include additional binaries in CI workflow. (#610)
CI / checkproto (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (agent) (push) Has been cancelled
CI / test (cli) (push) Has been cancelled
CI / test (cmd) (push) Has been cancelled
CI / test (internal) (push) Has been cancelled
CI / test (manager, true) (push) Has been cancelled
CI / test (pkg) (push) Has been cancelled
CI / upload-coverage (push) Has been cancelled

* feat: add FetchKbsToken RPC support, update protobuf generation, and include additional binaries in CI workflow.

Signed-off-by: Sammy Oina <sammyoina@gmail.com>

* chore: update protoc version and add GetKbsToken mock method with updated kbsHTTPGet signature

Signed-off-by: Sammy Oina <sammyoina@gmail.com>

* test: inject mock attestation client into agentService for resource and KBS tests

Signed-off-by: Sammy Oina <sammyoina@gmail.com>

* test: update key derivation in tests to use Concat KDF instead of HKDF

Signed-off-by: Sammy Oina <sammyoina@gmail.com>

---------

Signed-off-by: Sammy Oina <sammyoina@gmail.com>
This commit is contained in:
Sammy Kerata Oina
2026-07-06 15:26:15 +03:00
committed by GitHub
parent cbf2a44c6a
commit 13f7e97d82
33 changed files with 540 additions and 93 deletions
+18
View File
@@ -129,3 +129,21 @@ func (p *Provider) AzureAttestationToken(nonce []byte) ([]byte, error) {
return resp.Token, nil
}
// KbsToken retrieves the official KBS-signed token from the attestation agent.
func (p *Provider) KbsToken() ([]byte, error) {
fmt.Println("[CCAA-PROVIDER] KbsToken called, querying attestation-agent...")
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()
resp, err := p.client.GetToken(ctx, &attestation_agent.GetTokenRequest{
TokenType: "kbs",
})
if err != nil {
fmt.Printf("[CCAA-PROVIDER] GetToken failed: %v\n", err)
return nil, fmt.Errorf("CC attestation-agent GetToken failed for kbs: %w", err)
}
fmt.Printf("[CCAA-PROVIDER] GetToken succeeded! Return raw JSON message, len: %d\n", len(resp.Token))
return resp.Token, nil
}