Documentation
¶
Index ¶
Constants ¶
View Source
const ( NuonAuthCookieName string = "X-Nuon-Auth" NuonAuthSessionName string = "nuon-auth-session" )
Cookie and session names
View Source
const ( HeaderNuonAuthUser = "X-Nuon-Auth-User" HeaderNuonAuthEmail = "X-Nuon-Auth-Email" HeaderNuonAuthSuccess = "X-Nuon-Auth-Success" HeaderNuonAuthClaims = "X-Nuon-Auth-Claims" )
Response headers for validated requests
View Source
const (
// DefaultProviderID is the ID used for the env-configured default provider.
DefaultProviderID = "default"
)
Variables ¶
View Source
var ( // ErrAccountNotAuthorized is returned when a user tries to authenticate // but has no existing account and no pending org invite. ErrAccountNotAuthorized = errors.New("account not authorized: no existing account or pending invitation found") // ErrEmailDomainNotAllowed is returned when a user tries to authenticate // but their email domain is not in the allowed domains list. ErrEmailDomainNotAllowed = errors.New("email domain not allowed") )
Functions ¶
Types ¶
type DescribeTagsItem ¶
type DescribeTagsItem struct {
Key string `xml:"key"`
Value string `xml:"value"`
ResourceId string `xml:"resourceId"`
ResourceType string `xml:"resourceType"`
}
DescribeTagsItem represents a single tag item in the EC2 DescribeTags response
type DescribeTagsResponse ¶
type DescribeTagsResponse struct {
XMLName xml.Name `xml:"DescribeTagsResponse"`
TagSet struct {
Items []DescribeTagsItem `xml:"item"`
} `xml:"tagSet"`
}
DescribeTagsResponse represents the AWS EC2 DescribeTags response
type GetCallerIdentityResponse ¶
type GetCallerIdentityResponse struct {
XMLName xml.Name `xml:"GetCallerIdentityResponse"`
Result struct {
Arn string `xml:"Arn"`
UserId string `xml:"UserId"`
Account string `xml:"Account"`
} `xml:"GetCallerIdentityResult"`
}
GetCallerIdentityResponse represents the AWS STS GetCallerIdentity response
type ProviderOption ¶
ProviderOption represents a login option to display in the UI.
type RunnerAuthAWSRequest ¶
type RunnerAuthAWSRequest struct {
// STSRequest is a presigned GetCallerIdentity request
STSRequest *awstypes.PresignedRequest `json:"sts" validate:"required"`
// TagsRequest is a presigned EC2 DescribeTags request for the instance
TagsRequest *awstypes.PresignedRequest `json:"tags" validate:"required"`
}
RunnerAuthAWSRequest contains the presigned AWS requests from a runner
type RunnerAuthAWSResponse ¶
type RunnerAuthAWSResponse struct {
// Authenticated indicates whether the runner was successfully authenticated
Authenticated bool `json:"authenticated"`
// AccountID is the AWS account ID from the STS response
AccountID string `json:"account_id,omitempty"`
// ARN is the IAM role/user ARN from the STS response
ARN string `json:"arn,omitempty"`
// InstanceID is the EC2 instance ID from tags
InstanceID string `json:"instance_id,omitempty"`
// RunnerID is the Nuon runner ID from the instance tags
RunnerID string `json:"runner_id,omitempty"`
// Token is the authentication token issued to the runner
Token string `json:"token,omitempty"`
}
RunnerAuthAWSResponse contains the authentication result
Click to show internal directories.
Click to hide internal directories.