Documentation
¶
Overview ¶
Package authorization authorizes control operations and builds stable request hashes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func CanonicalizeIPPrefixes ¶
CanonicalizeIPPrefixes parses, masks, rejects duplicates, and sorts an IP policy. it preserves nil so an omitted policy differs from an empty policy.
func ValidateTarget ¶
ValidateTarget accepts the local HTTP target format used by public URLs.
Types ¶
type Authorizer ¶
type CertificatePlan ¶
type CertificatePlan struct {
CacheKey string `json:"cache_key"`
Scope string `json:"scope"`
Identifiers []string `json:"identifiers"`
ChallengeMethod certificateidentity.ChallengeMethod `json:"challenge_method"`
}
type Decision ¶
type Decision struct {
IdentityID string
TeamID string
ActingMembershipID string
ActingRole string
PublicURLMembershipID string
PolicyRevision uint64
DomainID string
CanonicalHostname string
PublicURLScope PublicURLScope
DNSAuthorityReference string
CertificatePlan *CertificatePlan
RetrySecret [32]byte
}
Decision contains current authority state accepted by control. RetrySecret is internal key material and is never part of the authority wire response.
type Digest ¶
func CanonicalRequestHash ¶
func CanonicalRequestHash(request OperationRequest) (Digest, error)
CanonicalRequestHash returns a stable hash for one authorized control change.
func IPPolicyHash ¶
IPPolicyHash hashes the normalized prefix list. A nil policy has no hash.
type OperationRequest ¶
type OperationRequest struct {
Operation Operation
TeamID string
MembershipID string
DomainID string
CanonicalHostname string
PublicURLScope PublicURLScope
PublicURLID string
PublishRunNumber uint64
PublicURLMutationRevision uint64
PolicyRevision uint64
Target string
AllowedIPPrefixes []string
Ephemeral bool
CertificatePlan *CertificatePlan
}
OperationRequest contains every value included in a mutation hash.
type PublicURLScope ¶
type PublicURLScope string
PublicURLScope identifies the ownership boundary for an authorized public URL.
const ( PublicURLScopeMember PublicURLScope = "member" )
func (PublicURLScope) Valid ¶
func (scope PublicURLScope) Valid() bool
type Request ¶
type Request struct {
AccessToken string
Operation Operation
TeamID string
ActingMembershipID string
PublicURLMembershipID string
DomainID string
CanonicalHostname string
PublicURLScope PublicURLScope
Target string
AllowedIPPrefixes []string
Ephemeral bool
PublicURLID string
PublishRunNumber uint64
PublicURLMutationRevision uint64
}
Request contains the user credential and exact operation facts control asks the authority to authorize.