Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterIdentityServiceServer(s grpc.ServiceRegistrar, srv IdentityServiceServer)
- type CanonicalPayload
- type Claim
- func (*Claim) Descriptor() ([]byte, []int)deprecated
- func (x *Claim) GetCertificate() string
- func (x *Claim) GetExpiresAt() string
- func (c *Claim) GetPayload() ([]byte, error)
- func (x *Claim) GetRecordCid() string
- func (x *Claim) GetRole() ClaimRole
- func (x *Claim) GetSignature() string
- func (x *Claim) GetSignedAt() string
- func (x *Claim) GetSubject() string
- func (c *Claim) MarshalReferrer() (*corev1.RecordReferrer, error)
- func (*Claim) ProtoMessage()
- func (x *Claim) ProtoReflect() protoreflect.Message
- func (x *Claim) Reset()
- func (x *Claim) String() string
- func (c *Claim) UnmarshalReferrer(ref *corev1.RecordReferrer) error
- type ClaimRole
- type ClaimVerification
- func (*ClaimVerification) Descriptor() ([]byte, []int)deprecated
- func (x *ClaimVerification) GetError() string
- func (x *ClaimVerification) GetRole() ClaimRole
- func (x *ClaimVerification) GetStatus() ClaimVerificationStatus
- func (x *ClaimVerification) GetSubject() string
- func (x *ClaimVerification) GetVerifiedAt() *timestamppb.Timestamp
- func (*ClaimVerification) ProtoMessage()
- func (x *ClaimVerification) ProtoReflect() protoreflect.Message
- func (x *ClaimVerification) Reset()
- func (x *ClaimVerification) String() string
- type ClaimVerificationStatus
- func (ClaimVerificationStatus) Descriptor() protoreflect.EnumDescriptor
- func (x ClaimVerificationStatus) Enum() *ClaimVerificationStatus
- func (ClaimVerificationStatus) EnumDescriptor() ([]byte, []int)deprecated
- func (x ClaimVerificationStatus) Number() protoreflect.EnumNumber
- func (x ClaimVerificationStatus) String() string
- func (ClaimVerificationStatus) Type() protoreflect.EnumType
- type GetIdentityStatusRequest
- func (*GetIdentityStatusRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetIdentityStatusRequest) GetCid() string
- func (x *GetIdentityStatusRequest) GetName() string
- func (x *GetIdentityStatusRequest) GetVersion() string
- func (*GetIdentityStatusRequest) ProtoMessage()
- func (x *GetIdentityStatusRequest) ProtoReflect() protoreflect.Message
- func (x *GetIdentityStatusRequest) Reset()
- func (x *GetIdentityStatusRequest) String() string
- type GetIdentityStatusResponse
- func (*GetIdentityStatusResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetIdentityStatusResponse) GetIdentity() *ClaimVerification
- func (x *GetIdentityStatusResponse) GetOwner() *ClaimVerification
- func (*GetIdentityStatusResponse) ProtoMessage()
- func (x *GetIdentityStatusResponse) ProtoReflect() protoreflect.Message
- func (x *GetIdentityStatusResponse) Reset()
- func (x *GetIdentityStatusResponse) String() string
- type IdentityServiceClient
- type IdentityServiceServer
- type ResolveRequest
- func (*ResolveRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ResolveRequest) GetName() string
- func (x *ResolveRequest) GetVersion() string
- func (*ResolveRequest) ProtoMessage()
- func (x *ResolveRequest) ProtoReflect() protoreflect.Message
- func (x *ResolveRequest) Reset()
- func (x *ResolveRequest) String() string
- type ResolveResponse
- type UnimplementedIdentityServiceServer
- type UnsafeIdentityServiceServer
Constants ¶
const ( IdentityService_GetIdentityStatus_FullMethodName = "/agntcy.dir.identity.v1.IdentityService/GetIdentityStatus" IdentityService_Resolve_FullMethodName = "/agntcy.dir.identity.v1.IdentityService/Resolve" )
Variables ¶
var ( ClaimRole_name = map[int32]string{ 0: "CLAIM_ROLE_UNSPECIFIED", 1: "CLAIM_ROLE_IDENTITY", 2: "CLAIM_ROLE_OWNER", } ClaimRole_value = map[string]int32{ "CLAIM_ROLE_UNSPECIFIED": 0, "CLAIM_ROLE_IDENTITY": 1, "CLAIM_ROLE_OWNER": 2, } )
Enum value maps for ClaimRole.
var ( ClaimVerificationStatus_name = map[int32]string{ 0: "CLAIM_VERIFICATION_STATUS_UNSPECIFIED", 1: "CLAIM_VERIFICATION_STATUS_VERIFIED", 2: "CLAIM_VERIFICATION_STATUS_FAILED", } ClaimVerificationStatus_value = map[string]int32{ "CLAIM_VERIFICATION_STATUS_UNSPECIFIED": 0, "CLAIM_VERIFICATION_STATUS_VERIFIED": 1, "CLAIM_VERIFICATION_STATUS_FAILED": 2, } )
Enum value maps for ClaimVerificationStatus.
var File_agntcy_dir_identity_v1_claim_proto protoreflect.FileDescriptor
var File_agntcy_dir_identity_v1_identity_service_proto protoreflect.FileDescriptor
var IdentityService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "agntcy.dir.identity.v1.IdentityService", HandlerType: (*IdentityServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetIdentityStatus", Handler: _IdentityService_GetIdentityStatus_Handler, }, { MethodName: "Resolve", Handler: _IdentityService_Resolve_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "agntcy/dir/identity/v1/identity_service.proto", }
IdentityService_ServiceDesc is the grpc.ServiceDesc for IdentityService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterIdentityServiceServer ¶
func RegisterIdentityServiceServer(s grpc.ServiceRegistrar, srv IdentityServiceServer)
Types ¶
type CanonicalPayload ¶
type CanonicalPayload struct {
RecordCID string `json:"record_cid"`
Role string `json:"role"`
Subject string `json:"subject"`
SignedAt string `json:"signed_at"`
ExpiresAt string `json:"expires_at"`
}
CanonicalPayload represents the deterministic payload of a claim that is used for signing and verification.
type Claim ¶
type Claim struct {
// What this claim asserts: the record's own identity, or its owner.
Role ClaimRole `protobuf:"varint,1,opt,name=role,proto3,enum=agntcy.dir.identity.v1.ClaimRole" json:"role,omitempty"`
// The CID of the record this claim is attached to. Part of the signed
// payload, so a claim cannot be replayed against a different record.
RecordCid string `protobuf:"bytes,2,opt,name=record_cid,json=recordCid,proto3" json:"record_cid,omitempty"`
// The identity URI being claimed (e.g. "did:web:acme.com:agents:finance",
// "spiffe://acme.com/agents/finance", "ans://v1.0.0.agent.acme.com"). Must match the record's own
// "agntcy.dir/identity" (role = CLAIM_ROLE_IDENTITY) or "agntcy.dir/owner"
// (role = CLAIM_ROLE_OWNER) annotation. The URI scheme determines how the
// subject is resolved/verified.
Subject string `protobuf:"bytes,3,opt,name=subject,proto3" json:"subject,omitempty"`
// Signing timestamp of the claim in the RFC3339 format. Part of the
// signed payload. Specs: https://www.rfc-editor.org/rfc/rfc3339.html
SignedAt string `protobuf:"bytes,4,opt,name=signed_at,json=signedAt,proto3" json:"signed_at,omitempty"`
// Expiration timestamp in the RFC3339 format. Consumers must reject a
// claim whose expires_at is in the past.
ExpiresAt *string `protobuf:"bytes,5,opt,name=expires_at,json=expiresAt,proto3,oneof" json:"expires_at,omitempty"`
// Detached JWS (RFC 7515) compact serialization. Signing/verification is
// a separate, later concern; empty until then.
Signature string `protobuf:"bytes,6,opt,name=signature,proto3" json:"signature,omitempty"`
// Base64-encoded DER X.509 certificate. Only set for a "spiffe://" or
// "ans://" subject, whose proof is a certificate (the X.509-SVID, or the
// identity certificate the agent's transparency log attests) and whose URI
// SAN must equal subject.
Certificate *string `protobuf:"bytes,7,opt,name=certificate,proto3,oneof" json:"certificate,omitempty"`
// contains filtered or unexported fields
}
Claim is a verifiable assertion of a record's identity or ownership.
Storage and management of claims is provided via StoreService as a RecordReferrer object:
type = "agntcy.dir.identity.v1.IdentityClaim" (role = CLAIM_ROLE_IDENTITY)
| "agntcy.dir.identity.v1.OwnershipClaim" (role = CLAIM_ROLE_OWNER)
data = Claim message encoded as JSON
One message covers both identity and ownership assertions, discriminated by role, since they are otherwise identical in shape. role is part of what is cryptographically signed (a separate, later concern) so a signature made for one role can never be replayed as the other.
func (*Claim) Descriptor
deprecated
func (*Claim) GetCertificate ¶
func (*Claim) GetExpiresAt ¶
func (*Claim) GetPayload ¶
GetPayload returns the deterministic bytes that are signed and verified for c. signature and certificate are never included: they don't exist yet at signing time, and aren't part of what the claim asserts.
func (*Claim) GetRecordCid ¶
func (*Claim) GetSignature ¶
func (*Claim) GetSignedAt ¶
func (*Claim) GetSubject ¶
func (*Claim) MarshalReferrer ¶
func (c *Claim) MarshalReferrer() (*corev1.RecordReferrer, error)
MarshalReferrer encodes c into a RecordReferrer.
func (*Claim) ProtoMessage ¶
func (*Claim) ProtoMessage()
func (*Claim) ProtoReflect ¶
func (x *Claim) ProtoReflect() protoreflect.Message
func (*Claim) UnmarshalReferrer ¶
func (c *Claim) UnmarshalReferrer(ref *corev1.RecordReferrer) error
UnmarshalReferrer loads c from a RecordReferrer.
type ClaimRole ¶
type ClaimRole int32
ClaimRole is what a Claim asserts about its subject.
func (ClaimRole) Descriptor ¶
func (ClaimRole) Descriptor() protoreflect.EnumDescriptor
func (ClaimRole) EnumDescriptor
deprecated
func (ClaimRole) Number ¶
func (x ClaimRole) Number() protoreflect.EnumNumber
func (ClaimRole) Type ¶
func (ClaimRole) Type() protoreflect.EnumType
type ClaimVerification ¶
type ClaimVerification struct {
// The role the verified claim asserts.
Role ClaimRole `protobuf:"varint,1,opt,name=role,proto3,enum=agntcy.dir.identity.v1.ClaimRole" json:"role,omitempty"`
// The identity URI the claim asserts.
Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"`
// The outcome of the last verification.
Status ClaimVerificationStatus `protobuf:"varint,3,opt,name=status,proto3,enum=agntcy.dir.identity.v1.ClaimVerificationStatus" json:"status,omitempty"`
// Why verification failed. Only set when status is FAILED.
Error *string `protobuf:"bytes,4,opt,name=error,proto3,oneof" json:"error,omitempty"`
// When the claim was last verified.
VerifiedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=verified_at,json=verifiedAt,proto3" json:"verified_at,omitempty"`
// contains filtered or unexported fields
}
ClaimVerification is the last verification result of one claim of a record.
func (*ClaimVerification) Descriptor
deprecated
func (*ClaimVerification) Descriptor() ([]byte, []int)
Deprecated: Use ClaimVerification.ProtoReflect.Descriptor instead.
func (*ClaimVerification) GetError ¶
func (x *ClaimVerification) GetError() string
func (*ClaimVerification) GetRole ¶
func (x *ClaimVerification) GetRole() ClaimRole
func (*ClaimVerification) GetStatus ¶
func (x *ClaimVerification) GetStatus() ClaimVerificationStatus
func (*ClaimVerification) GetSubject ¶
func (x *ClaimVerification) GetSubject() string
func (*ClaimVerification) GetVerifiedAt ¶
func (x *ClaimVerification) GetVerifiedAt() *timestamppb.Timestamp
func (*ClaimVerification) ProtoMessage ¶
func (*ClaimVerification) ProtoMessage()
func (*ClaimVerification) ProtoReflect ¶
func (x *ClaimVerification) ProtoReflect() protoreflect.Message
func (*ClaimVerification) Reset ¶
func (x *ClaimVerification) Reset()
func (*ClaimVerification) String ¶
func (x *ClaimVerification) String() string
type ClaimVerificationStatus ¶
type ClaimVerificationStatus int32
ClaimVerificationStatus is the outcome of verifying a claim.
const ( ClaimVerificationStatus_CLAIM_VERIFICATION_STATUS_UNSPECIFIED ClaimVerificationStatus = 0 // The claim's signature and subject were verified. ClaimVerificationStatus_CLAIM_VERIFICATION_STATUS_VERIFIED ClaimVerificationStatus = 1 // Verification was attempted and failed; see ClaimVerification.error. ClaimVerificationStatus_CLAIM_VERIFICATION_STATUS_FAILED ClaimVerificationStatus = 2 )
func (ClaimVerificationStatus) Descriptor ¶
func (ClaimVerificationStatus) Descriptor() protoreflect.EnumDescriptor
func (ClaimVerificationStatus) Enum ¶
func (x ClaimVerificationStatus) Enum() *ClaimVerificationStatus
func (ClaimVerificationStatus) EnumDescriptor
deprecated
func (ClaimVerificationStatus) EnumDescriptor() ([]byte, []int)
Deprecated: Use ClaimVerificationStatus.Descriptor instead.
func (ClaimVerificationStatus) Number ¶
func (x ClaimVerificationStatus) Number() protoreflect.EnumNumber
func (ClaimVerificationStatus) String ¶
func (x ClaimVerificationStatus) String() string
func (ClaimVerificationStatus) Type ¶
func (ClaimVerificationStatus) Type() protoreflect.EnumType
type GetIdentityStatusRequest ¶
type GetIdentityStatusRequest struct {
// The CID of the record to check.
// If provided, name and version are ignored.
Cid *string `protobuf:"bytes,1,opt,name=cid,proto3,oneof" json:"cid,omitempty"`
// The name of the record to check (e.g., "cisco.com/agent").
// Used when cid is not provided.
Name *string `protobuf:"bytes,2,opt,name=name,proto3,oneof" json:"name,omitempty"`
// Optional version when looking up by name (e.g., "v1.0.0").
// If not specified, the latest version is used.
Version *string `protobuf:"bytes,3,opt,name=version,proto3,oneof" json:"version,omitempty"`
// contains filtered or unexported fields
}
GetIdentityStatusRequest is the request for retrieving claim verification status. Either cid OR name must be provided. If name is provided, it is resolved to a CID first (using the latest version if version is not specified).
func (*GetIdentityStatusRequest) Descriptor
deprecated
func (*GetIdentityStatusRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetIdentityStatusRequest.ProtoReflect.Descriptor instead.
func (*GetIdentityStatusRequest) GetCid ¶
func (x *GetIdentityStatusRequest) GetCid() string
func (*GetIdentityStatusRequest) GetName ¶
func (x *GetIdentityStatusRequest) GetName() string
func (*GetIdentityStatusRequest) GetVersion ¶
func (x *GetIdentityStatusRequest) GetVersion() string
func (*GetIdentityStatusRequest) ProtoMessage ¶
func (*GetIdentityStatusRequest) ProtoMessage()
func (*GetIdentityStatusRequest) ProtoReflect ¶
func (x *GetIdentityStatusRequest) ProtoReflect() protoreflect.Message
func (*GetIdentityStatusRequest) Reset ¶
func (x *GetIdentityStatusRequest) Reset()
func (*GetIdentityStatusRequest) String ¶
func (x *GetIdentityStatusRequest) String() string
type GetIdentityStatusResponse ¶
type GetIdentityStatusResponse struct {
// The record's identity claim result. Unset if no identity claim has been
// verified.
Identity *ClaimVerification `protobuf:"bytes,1,opt,name=identity,proto3,oneof" json:"identity,omitempty"`
// The record's ownership claim result. Unset if no ownership claim has been
// verified.
Owner *ClaimVerification `protobuf:"bytes,2,opt,name=owner,proto3,oneof" json:"owner,omitempty"`
// contains filtered or unexported fields
}
GetIdentityStatusResponse is the response for retrieving claim verification status.
func (*GetIdentityStatusResponse) Descriptor
deprecated
func (*GetIdentityStatusResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetIdentityStatusResponse.ProtoReflect.Descriptor instead.
func (*GetIdentityStatusResponse) GetIdentity ¶
func (x *GetIdentityStatusResponse) GetIdentity() *ClaimVerification
func (*GetIdentityStatusResponse) GetOwner ¶
func (x *GetIdentityStatusResponse) GetOwner() *ClaimVerification
func (*GetIdentityStatusResponse) ProtoMessage ¶
func (*GetIdentityStatusResponse) ProtoMessage()
func (*GetIdentityStatusResponse) ProtoReflect ¶
func (x *GetIdentityStatusResponse) ProtoReflect() protoreflect.Message
func (*GetIdentityStatusResponse) Reset ¶
func (x *GetIdentityStatusResponse) Reset()
func (*GetIdentityStatusResponse) String ¶
func (x *GetIdentityStatusResponse) String() string
type IdentityServiceClient ¶
type IdentityServiceClient interface {
// GetIdentityStatus returns the last verification result of a record's
// identity and ownership claims. A claim that has not been verified yet is
// left unset in the response, which is not an error.
GetIdentityStatus(ctx context.Context, in *GetIdentityStatusRequest, opts ...grpc.CallOption) (*GetIdentityStatusResponse, error)
// Resolve resolves a record reference (name with optional version) to CIDs.
// - "name" -> returns all versions (newest first)
// - "name" with version -> returns the specific version
//
// Returns an error if no matching record is found.
Resolve(ctx context.Context, in *ResolveRequest, opts ...grpc.CallOption) (*ResolveResponse, error)
}
IdentityServiceClient is the client API for IdentityService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
IdentityService exposes the verification status of a record's identity and ownership claims, and resolves record names. It is read-only: claim verification results are written by the reconciler.
func NewIdentityServiceClient ¶
func NewIdentityServiceClient(cc grpc.ClientConnInterface) IdentityServiceClient
type IdentityServiceServer ¶
type IdentityServiceServer interface {
// GetIdentityStatus returns the last verification result of a record's
// identity and ownership claims. A claim that has not been verified yet is
// left unset in the response, which is not an error.
GetIdentityStatus(context.Context, *GetIdentityStatusRequest) (*GetIdentityStatusResponse, error)
// Resolve resolves a record reference (name with optional version) to CIDs.
// - "name" -> returns all versions (newest first)
// - "name" with version -> returns the specific version
//
// Returns an error if no matching record is found.
Resolve(context.Context, *ResolveRequest) (*ResolveResponse, error)
}
IdentityServiceServer is the server API for IdentityService service. All implementations should embed UnimplementedIdentityServiceServer for forward compatibility.
IdentityService exposes the verification status of a record's identity and ownership claims, and resolves record names. It is read-only: claim verification results are written by the reconciler.
type ResolveRequest ¶
type ResolveRequest struct {
// The name of the record to resolve (e.g., "cisco.com/agent").
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// Optional version to resolve to (e.g., "v1.0.0").
Version *string `protobuf:"bytes,2,opt,name=version,proto3,oneof" json:"version,omitempty"`
// contains filtered or unexported fields
}
ResolveRequest is the request for resolving a record reference to CIDs.
func (*ResolveRequest) Descriptor
deprecated
func (*ResolveRequest) Descriptor() ([]byte, []int)
Deprecated: Use ResolveRequest.ProtoReflect.Descriptor instead.
func (*ResolveRequest) GetName ¶
func (x *ResolveRequest) GetName() string
func (*ResolveRequest) GetVersion ¶
func (x *ResolveRequest) GetVersion() string
func (*ResolveRequest) ProtoMessage ¶
func (*ResolveRequest) ProtoMessage()
func (*ResolveRequest) ProtoReflect ¶
func (x *ResolveRequest) ProtoReflect() protoreflect.Message
func (*ResolveRequest) Reset ¶
func (x *ResolveRequest) Reset()
func (*ResolveRequest) String ¶
func (x *ResolveRequest) String() string
type ResolveResponse ¶
type ResolveResponse struct {
// The resolved record references (newest first by created_at).
Records []*v1.NamedRecordRef `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"`
// contains filtered or unexported fields
}
ResolveResponse is the response containing the resolved records.
func (*ResolveResponse) Descriptor
deprecated
func (*ResolveResponse) Descriptor() ([]byte, []int)
Deprecated: Use ResolveResponse.ProtoReflect.Descriptor instead.
func (*ResolveResponse) GetRecords ¶
func (x *ResolveResponse) GetRecords() []*v1.NamedRecordRef
func (*ResolveResponse) ProtoMessage ¶
func (*ResolveResponse) ProtoMessage()
func (*ResolveResponse) ProtoReflect ¶
func (x *ResolveResponse) ProtoReflect() protoreflect.Message
func (*ResolveResponse) Reset ¶
func (x *ResolveResponse) Reset()
func (*ResolveResponse) String ¶
func (x *ResolveResponse) String() string
type UnimplementedIdentityServiceServer ¶
type UnimplementedIdentityServiceServer struct{}
UnimplementedIdentityServiceServer should be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedIdentityServiceServer) GetIdentityStatus ¶
func (UnimplementedIdentityServiceServer) GetIdentityStatus(context.Context, *GetIdentityStatusRequest) (*GetIdentityStatusResponse, error)
func (UnimplementedIdentityServiceServer) Resolve ¶
func (UnimplementedIdentityServiceServer) Resolve(context.Context, *ResolveRequest) (*ResolveResponse, error)
type UnsafeIdentityServiceServer ¶
type UnsafeIdentityServiceServer interface {
// contains filtered or unexported methods
}
UnsafeIdentityServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to IdentityServiceServer will result in compilation errors.