Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIClient ¶
type APIClient struct {
ID string `bson:"id"`
Name string `bson:"name"`
Trusted bool `bson:"trusted"`
Scopes []string `bson:"scopes"`
RedirectURLs []string `bson:"redirect_urls"`
Secret string `bson:"secret"`
}
APIClient is the data stored about an api client in the database
func GetAPIClientByID ¶
GetAPIClientByID an api client from the database by id
type Attempt ¶
type Attempt struct {
ID string `bson:"id"`
User string `bson:"user"`
Challenge string `bson:"challenge"`
CreationDate time.Time `bson:"creation_date"`
TimeoutDate time.Time `bson:"timeout_date"`
SubmissionDate time.Time `bson:"submission_date"`
Input *AttemptInput `bson:"input"`
ExpectedOutput *AttemptOutput `bson:"expected_output"`
RecievedOutput *AttemptOutput `bson:"recieved_output"`
}
Attempt is the data stored about an attempt in the database
func GetAttemptByID ¶
GetAttemptByID an attempt from the database by id
type AttemptInput ¶
AttemptInput is the input data for a specifc attempt
type AttemptOutput ¶
AttemptOutput is the output data for a specifc attempt
type Challenge ¶
type Challenge struct {
ID string `bson:"id"`
Name string `bson:"name"`
Description string `bson:"description"`
Generator string `bson:"generator"`
MaxLiveAttempts int `bson:"max_live_attempts"`
Timeout time.Duration `bson:"timeout"`
PublishDate time.Time `bson:"publish_date"`
ResultsDate time.Time `bson:"results_date"`
}
Challenge is the data stored about a challenge in the database
func GetChallengeByID ¶
GetChallengeByID a challenge from the database by id
func GetChallenges ¶
GetChallenges all challenges from the database
type RootTrustClient ¶
type RootTrustClient struct {
ID string `bson:"id"`
Name string `bson:"name"`
Secret string `bson:"secret"`
}
RootTrustClient is a client that can talk to the authentication endpoints
func GetRootTrustClientByID ¶
func GetRootTrustClientByID(id string) (*RootTrustClient, error)
GetRootTrustClientByID a root trust client from the database by id
func (*RootTrustClient) Save ¶
func (client *RootTrustClient) Save() error
Save api client data to the database
type User ¶
type User struct {
ID string `bson:"id"`
FullName string `bson:"full_name"`
Email string `bson:"email"`
AvatarURL string `bson:"avatar_url"`
OTPEnabled bool `bson:"otp_enabled"`
Password string `bson:"password"`
OTPSecret string `bson:"otp_secret"`
Scopes []string `bson:"scopes"`
}
User is the data stored about a single user in the database
func GetUserByEmail ¶
GetUserByEmail a user from the database by email
func GetUserByID ¶
GetUserByID a user from the database by id