Documentation
¶
Overview ¶
Package phalacloud implements the Attester and RequestPreparer interfaces for Phala Cloud's TEE attestation API (RedPill gateway).
RedPill is a multi-backend gateway that returns attestation in different formats depending on the backend model. Supported formats:
- chutes: "attestation_type" key present → provider.ParseChutesFormat
- dstack: "intel_quote" key present → delegates to nanogpt.ParseAttestationResponse
- tinfoil: "format" key present → not yet supported
- gateway: "gateway_attestation" key present → not yet supported
Phala Cloud attestation endpoint:
GET {base_url}/v1/attestation/report?model={model}&nonce={nonce}
Authorization: Bearer {api_key}
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseAttestationResponse ¶
func ParseAttestationResponse(ctx context.Context, body []byte) (*attestation.RawAttestation, error)
ParseAttestationResponse detects the attestation format from the JSON body and delegates to the appropriate backend parser.
Types ¶
type Attester ¶
type Attester struct {
// contains filtered or unexported fields
}
Attester fetches attestation data from Phala Cloud's attestation endpoint. The nonce is sent as a query parameter; the server may generate its own.
func NewAttester ¶
NewAttester returns a Phala Cloud Attester configured with the given base URL and API key. Uses an extended timeout because Phala Cloud's multi-instance attestation endpoint is slow.
func (*Attester) FetchAttestation ¶
func (a *Attester) FetchAttestation(ctx context.Context, model string, nonce attestation.Nonce) (*attestation.RawAttestation, error)
FetchAttestation fetches TEE attestation from Phala Cloud. The nonce is sent as a query parameter. Format detection is performed on the response body to delegate to the correct backend parser.
type Preparer ¶
type Preparer struct {
// contains filtered or unexported fields
}
Preparer injects the Phala Cloud Authorization header into outgoing requests.
func NewPreparer ¶
NewPreparer returns a Phala Cloud Preparer configured with the given API key.