Documentation
¶
Overview ¶
Package mds fetches, verifies, caches, and queries FIDO Metadata Service blobs.
Index ¶
Constants ¶
const ( DefaultSource = "https://mds.fidoalliance.org/" DefaultRefreshInterval = 24 * time.Hour DefaultMaxBlobBytes = 64 << 20 // 64 MiB )
Variables ¶
Functions ¶
func AssessAttestation ¶
func AssessAttestation( evidence AttestationEvidence, metadata model.LookupResult, currentTime time.Time, ) model.AttestationTrustAssessment
AssessAttestation evaluates attestation evidence against one verified MDS lookup result. It does not apply relying-party certification policy.
Types ¶
type AttestationEvidence ¶
type AttestationEvidence struct {
AAGUID uuid.UUID
Type AttestationType
CertificateChain [][]byte
}
AttestationEvidence identifies the authenticator and carries the untrusted certificate chain extracted from a verified attestation statement.
type AttestationType ¶
type AttestationType string
AttestationType describes the trust material exposed by a format-level attestation verifier. It deliberately does not prescribe relying-party certification policy.
const ( AttestationTypeNone AttestationType = "none" AttestationTypeSelf AttestationType = "self" AttestationTypeBasic AttestationType = "basic" AttestationTypeUnsupported AttestationType = "unsupported" )
type Blob ¶
type Blob struct {
Number uint64
// IssuedAt is best-effort metadata. It is read from the MDS JWT header iat
// when present, otherwise from the standard payload iat parsed by
// jwt.RegisteredClaims. It is zero when both are absent.
IssuedAt time.Time
Entries map[uuid.UUID]*appmds.PayloadEntry
CachedAt time.Time
}
Blob is a verified and indexed MDS payload. Treat it as immutable after storing it in Cache.
type Cache ¶
type Cache interface {
Get(source string) (*Blob, bool)
Set(source string, blob *Blob)
Refresh(context.Context, string, func() (*Blob, bool, error)) (*Blob, bool, error)
}
Cache stores verified MDS blobs and coordinates refreshes by cache key.
type Client ¶
type Client struct {
Source string
HTTPClient *http.Client
Cache Cache
CacheDir string
TrustAnchors []*x509.Certificate
// MaxBlobBytes bounds metadata BLOB downloads. Zero means DefaultMaxBlobBytes.
MaxBlobBytes int64
// Now is injectable for deterministic tests.
Now func() time.Time
}
Client fetches, caches, and looks up verified FIDO Metadata Service blobs. Signature, x5u/x5c, certificate-chain and CRL validation live in internal/mdsverify.
type HTTPStatusError ¶
type HTTPStatusError struct {
StatusCode int
}
HTTPStatusError reports a non-success response from the configured MDS endpoint.
func (*HTTPStatusError) Error ¶
func (e *HTTPStatusError) Error() string
func (*HTTPStatusError) Unwrap ¶
func (e *HTTPStatusError) Unwrap() error
type LookupOptions ¶
type LookupOptions struct {
// Refresh forces a conditional network refresh attempt, but still loads the
// local copy first so localCopySerial and anti-rollback checks keep working.
Refresh bool
}
LookupOptions configures one MDS lookup.