Documentation
¶
Overview ¶
Package models provides http request and response structs
Index ¶
- Variables
- type AccountAccessReply
- type AccountAccessRequest
- type AccountRolesOrganizationReply
- type AccountRolesOrganizationRequest
- type AccountRolesReply
- type AccountRolesRequest
- type Address
- type AuthData
- type File
- type ForgotPasswordReply
- type ForgotPasswordRequest
- type InviteReply
- type InviteRequest
- type LoginReply
- type LoginRequest
- type OauthTokenRequest
- type Price
- type RefreshReply
- type RefreshRequest
- type RegisterReply
- type RegisterRequest
- type ResendReply
- type ResendRequest
- type ResetPasswordReply
- type ResetPasswordRequest
- type SwitchOrganizationReply
- type SwitchOrganizationRequest
- type TFAReply
- type TFARequest
- type UploadFilesReply
- type UploadFilesRequest
- type VerifyReply
- type VerifyRequest
- type VerifySubscribeReply
- type VerifySubscribeRequest
- type WebauthnBeginLoginResponse
- type WebauthnBeginRegistrationResponse
- type WebauthnLoginResponse
- type WebauthnRegistrationRequest
- type WebauthnRegistrationResponse
Constants ¶
This section is empty.
Variables ¶
var ExampleAccountAccessReply = AccountAccessReply{ Reply: rout.Reply{Success: true}, Allowed: true, }
ExampleAccountAccessReply is an example of a successful `/account/access` response for OpenAPI documentation
var ExampleAccountAccessRequest = AccountAccessRequest{
Relation: "can_view",
ObjectType: "organization",
ObjectID: "01J4EXD5MM60CX4YNYN0DEE3Y1",
}
ExampleAccountAccessRequest is an example of a successful `/account/access` request for OpenAPI documentation
var ExampleAccountRolesOrganizationReply = AccountRolesOrganizationReply{ Reply: rout.Reply{Success: true}, Roles: []string{"can_view", "can_edit", "audit_log_viewer"}, OrganizationID: "01J4HMNDSZCCQBTY93BF9CBF5D", }
ExampleAccountRolesOrganizationReply is an example of a successful `/account/roles/organization` response for OpenAPI documentation
var ExampleAccountRolesOrganizationRequest = AccountRolesOrganizationRequest{
ID: "01J4HMNDSZCCQBTY93BF9CBF5D",
}
ExampleAccountRolesOrganizationRequest is an example of a successful `/account/roles/organization` request for OpenAPI documentation
var ExampleAccountRolesReply = AccountRolesReply{ Reply: rout.Reply{Success: true}, Roles: []string{"can_view", "can_edit", "audit_log_viewer"}, }
ExampleAccountRolesReply is an example of a successful `/account/roles` response for OpenAPI documentation
var ExampleAccountRolesRequest = AccountRolesRequest{
ObjectType: "organization",
ObjectID: "01J4EXD5MM60CX4YNYN0DEE3Y1",
}
ExampleAccountRolesRequest is an example of a successful `/account/roles` request for OpenAPI documentation
var ExampleForgotPasswordSuccessRequest = ForgotPasswordRequest{
Email: "example@theopenlane.io",
}
ExampleForgotPasswordSuccessRequest is an example of a successful forgot password request for OpenAPI documentation
var ExampleForgotPasswordSuccessResponse = ForgotPasswordReply{ Reply: rout.Reply{ Success: true, }, Message: "We've received your request to have the password associated with this email reset. Please check your email.", }
ExampleForgotPasswordSuccessResponse is an example of a successful forgot password response for OpenAPI documentation
var ExampleInviteRequest = InviteRequest{
Token: "token",
}
ExampleInviteRequest is an example of a successful invite request for OpenAPI documentation
var ExampleInviteResponse = InviteReply{ Reply: rout.Reply{Success: true}, ID: "1234", Email: "", JoinedOrgID: "1234", Role: "admin", Message: "Welcome to your new organization!", AuthData: AuthData{ AccessToken: "access_token", RefreshToken: "refresh_token", Session: "session", TokenType: "bearer", }, }
ExampleInviteResponse is an example of a successful invite response for OpenAPI documentation
var ExampleLoginSuccessRequest = LoginRequest{
Username: "sfunky@theopenlane.io",
Password: "mitb!",
}
ExampleLoginSuccessRequest is an example of a successful login request for OpenAPI documentation
var ExampleLoginSuccessResponse = LoginReply{ Reply: rout.Reply{ Success: true, }, AuthData: AuthData{ AccessToken: "access_token", RefreshToken: "refresh_token", Session: "session", TokenType: "bearer", }, }
ExampleLoginSuccessResponse is an example of a successful login response for OpenAPI documentation
var ExampleRefreshRequest = RefreshRequest{
RefreshToken: "token",
}
ExampleRefreshRequest is an example of a successful refresh request for OpenAPI documentation
var ExampleRefreshSuccessResponse = RefreshReply{ Reply: rout.Reply{Success: true}, Message: "success", AuthData: AuthData{ AccessToken: "access_token", RefreshToken: "refresh_token", Session: "session", TokenType: "bearer", }, }
ExampleRefreshSuccessResponse is an example of a successful refresh response for OpenAPI documentation
var ExampleRegisterSuccessRequest = RegisterRequest{
FirstName: "Sarah",
LastName: "Funk",
Email: "sfunky@theopenlane.io",
Password: "mitb!",
}
ExampleRegisterSuccessRequest is an example of a successful register request for OpenAPI documentation
var ExampleRegisterSuccessResponse = RegisterReply{ Reply: rout.Reply{Success: true}, ID: "1234", Email: "", Message: "Welcome to Openlane!", }
ExampleRegisterSuccessResponse is an example of a successful register response for OpenAPI documentation
var ExampleResendEmailSuccessRequest = ResendRequest{
Email: "cercei.lannister@theopenlane.io",
}
ExampleResendEmailSuccessRequest is an example of a successful resend email request for OpenAPI documentation
var ExampleResendEmailSuccessResponse = ResendReply{ Reply: rout.Reply{ Success: true, }, Message: "Email has been resent", }
ExampleResendEmailSuccessResponse is an example of a successful resend email response for OpenAPI documentation
var ExampleResetPasswordSuccessRequest = ResetPasswordRequest{
Password: "mitb!",
Token: "token",
}
ExampleResetPasswordSuccessRequest is an example of a successful reset password request for OpenAPI documentation
var ExampleResetPasswordSuccessResponse = ResetPasswordReply{ Reply: rout.Reply{ Success: true, }, Message: "Password has been reset", }
ExampleResetPasswordSuccessResponse is an example of a successful reset password response for OpenAPI documentation
var ExampleSwitchSuccessReply = SwitchOrganizationReply{ Reply: rout.Reply{ Success: true, }, AuthData: AuthData{ AccessToken: "access_token", RefreshToken: "refresh_token", Session: "session", TokenType: "bearer", }, }
ExampleSwitchSuccessReply is an example of a successful switch organization response for OpenAPI documentation
var ExampleSwitchSuccessRequest = SwitchOrganizationRequest{ TargetOrganizationID: ulids.New().String(), }
ExampleSwitchSuccessRequest is an example of a successful switch organization request for OpenAPI documentation
var ExampleTFASSuccessResponse = TFAReply{ Reply: rout.Reply{ Success: true, }, }
ExampleLoginSuccessResponse is an example of a successful tfa validation response for OpenAPI documentation
var ExampleTFASuccessRequest = TFARequest{
TOTPCode: "113371",
}
ExampleLoginSuccessRequest is an example of a successful tfa validation request for OpenAPI documentation
var ExampleUploadFileRequest = UploadFilesRequest{ UploadFile: multipart.FileHeader{ Filename: "file.txt", Size: 1024, Header: textproto.MIMEHeader{ "Content-Type": []string{"text/plain"}, }, }, }
ExampleUploadFileRequest is an example of a successful upload request for OpenAPI documentation
var ExampleUploadFilesSuccessResponse = UploadFilesReply{ Reply: rout.Reply{ Success: true, }, Message: "file(s) uploaded successfully", FileCount: 1, Files: []File{ { ID: "1234", Name: "file.txt", Size: 1024, MimeType: "text/plain", ContentType: "text/plain", PresignedURL: "https://example.com/file.txt", MD5: []byte("1234"), CreatedAt: time.Now(), UpdatedAt: time.Now(), }, }, }
ExampleUploadFilesSuccessResponse is an example of a successful upload response for OpenAPI documentation
var ExampleVerifySubscriptionResponse = VerifySubscribeReply{ Reply: rout.Reply{Success: true}, Message: "Subscription confirmed, looking forward to sending you updates!", }
ExampleVerifySubscriptionResponse is an example of a successful verify subscription response for OpenAPI documentation
var ExampleVerifySubscriptionSuccessRequest = VerifySubscribeRequest{
Token: "token",
}
ExampleVerifySubscriptionSuccessRequest is an example of a successful verify subscription request for OpenAPI documentation
var ExampleVerifySuccessRequest = VerifyRequest{
Token: "token",
}
ExampleVerifySuccessRequest is an example of a successful verify request for OpenAPI documentation
var ExampleVerifySuccessResponse = VerifyReply{ Reply: rout.Reply{ Success: true, }, ID: ulids.New().String(), Email: "gregor.clegane@theopenlane.io", Message: "Email has been verified", AuthData: AuthData{ AccessToken: "access_token", RefreshToken: "refresh_token", Session: "session", TokenType: "bearer", }, }
ExampleVerifySuccessResponse is an example of a successful verify response for OpenAPI documentation
var ExampleWebauthnBeginRegistrationRequest = WebauthnRegistrationRequest{
Email: "sarahisthebest@sarahsthebest.com",
Name: "Sarah Funk",
}
var ExampleWebauthnBeginRegistrationResponse = WebauthnBeginRegistrationResponse{ Reply: rout.Reply{Success: true}, CredentialCreation: &protocol.CredentialCreation{ Response: protocol.PublicKeyCredentialCreationOptions{ RelyingParty: protocol.RelyingPartyEntity{}, User: protocol.UserEntity{}, Challenge: protocol.URLEncodedBase64{}, }}, Session: "session", }
Functions ¶
This section is empty.
Types ¶
type AccountAccessReply ¶
AccountAccessReply holds the fields that are sent on a response to the `/account/access` endpoint
type AccountAccessRequest ¶
type AccountAccessRequest struct { ObjectID string `json:"objectId" description:"The ID of the object to check access for" example:"01J4EXD5MM60CX4YNYN0DEE3Y1"` ObjectType string `` /* 137-byte string literal not displayed */ Relation string `json:"relation" description:"The relation to check access for, e.g. can_view, can_edit" example:"can_view"` SubjectType string `json:"subjectType,omitempty" description:"The type of subject to check access for, e.g. service, user" example:"user"` }
AccountAccessRequest holds the fields that should be included on a request to the `/account/access` endpoint
func (*AccountAccessRequest) Validate ¶
func (r *AccountAccessRequest) Validate() error
Validate ensures the required fields are set on the AccountAccessRequest
type AccountRolesOrganizationReply ¶
type AccountRolesOrganizationReply struct { rout.Reply Roles []string `json:"roles" description:"The roles the user has in the organization, e.g. can_view, can_edit" example:"can_view, can_edit"` OrganizationID string `json:"organization_id" description:"The ID of the organization the user has roles in" example:"01J4HMNDSZCCQBTY93BF9CBF5D"` }
AccountRolesOrganizationReply holds the fields that are sent on a response to the `/account/roles/organization` endpoint
type AccountRolesOrganizationRequest ¶
type AccountRolesOrganizationRequest struct {
ID string `param:"id" description:"The ID of the organization to check roles for" example:"01J4HMNDSZCCQBTY93BF9CBF5D"`
}
AccountRolesOrganizationRequest holds the fields that should be included on a request to the `/account/roles/organization` endpoint
func (*AccountRolesOrganizationRequest) Validate ¶
func (r *AccountRolesOrganizationRequest) Validate() error
Validate ensures the required fields are set on the AccountAccessRequest
type AccountRolesReply ¶
AccountRolesReply holds the fields that are sent on a response to the `/account/roles` endpoint
type AccountRolesRequest ¶
type AccountRolesRequest struct { ObjectID string `json:"objectId" description:"The ID of the object to check roles for" example:"01J4EXD5MM60CX4YNYN0DEE3Y1"` ObjectType string `` /* 136-byte string literal not displayed */ SubjectType string `json:"subjectType,omitempty" description:"The type of subject to check roles for, e.g. service, user" example:"user"` Relations []string `json:"relations,omitempty" description:"The relations to check roles for, e.g. can_view, can_edit" example:"can_view"` }
AccountRolesRequest holds the fields that should be included on a request to the `/account/roles` endpoint
func (*AccountRolesRequest) Validate ¶
func (r *AccountRolesRequest) Validate() error
Validate ensures the required fields are set on the AccountAccessRequest
type Address ¶ added in v0.6.6
type Address struct { // Line1 is the first line of the address Line1 string `json:"line1"` // Line2 is the second line of the address Line2 string `json:"line2"` // City is the city of the address City string `json:"city"` // State is the state of the address State string `json:"state"` // PostalCode is the postal code of the address PostalCode string `json:"postalCode"` // Country is the country of the address Country string `json:"country"` }
Address is a custom type for Address
func (Address) MarshalGQL ¶ added in v0.6.6
MarshalGQL implement the Marshaler interface for gqlgen
func (*Address) UnmarshalGQL ¶ added in v0.6.6
UnmarshalGQL implement the Unmarshaler interface for gqlgen
type AuthData ¶
type AuthData struct { AccessToken string `json:"access_token" description:"The access token to be used for authentication"` RefreshToken string `json:"refresh_token,omitempty" description:"The refresh token to be used to refresh the access token after it expires"` Session string `json:"session,omitempty" description:"The short-lived session token required for authentication"` TokenType string `json:"token_type,omitempty" description:"The type of token being returned" example:"bearer"` }
type File ¶ added in v0.3.0
type File struct { ID string `json:"id,omitempty" description:"The ID of the uploaded file"` Name string `json:"name,omitempty" description:"The name of the uploaded file"` Size int64 `json:"size,omitempty" description:"The size of the uploaded file in bytes"` MimeType string `json:"mime_type,omitempty" description:"The mime type of the uploaded file"` ContentType string `json:"content_type,omitempty" description:"The content type of the uploaded file"` PresignedURL string `json:"presigned_url,omitempty" description:"The presigned URL to download the file"` MD5 []byte `json:"md5,omitempty" description:"The MD5 hash of the uploaded file"` CreatedAt time.Time `json:"created_at,omitempty" description:"The time the file was uploaded"` UpdatedAt time.Time `json:"updated_at,omitempty" description:"The time the file was last updated"` }
File holds the fields that are sent on a response to the `/upload` endpoint
type ForgotPasswordReply ¶
ForgotPasswordReply contains fields for a forgot password response
type ForgotPasswordRequest ¶
type ForgotPasswordRequest struct {
Email string `` /* 136-byte string literal not displayed */
}
ForgotPasswordRequest contains fields for a forgot password request
func (*ForgotPasswordRequest) Validate ¶
func (r *ForgotPasswordRequest) Validate() error
Validate ensures the required fields are set on the ForgotPasswordRequest request
type InviteReply ¶
type InviteReply struct { rout.Reply ID string `json:"user_id" description:"The ID of the user that was created" example:"01J4EXD5MM60CX4YNYN0DEE3Y1"` Email string `json:"email" description:"The email address of the user" example:"jsnow@example.com"` Message string `json:"message"` JoinedOrgID string `json:"joined_org_id" description:"The ID of the organization the user joined" example:"01JJFVMGENQS9ZG3GVA50QVX5E"` Role string `json:"role" description:"The role the user has in the organization" example:"admin"` AuthData }
InviteReply holds the fields that are sent on a response to an accepted invitation
type InviteRequest ¶
type InviteRequest struct {
Token string `query:"token" description:"The token to be used to accept the invitation, token is sent via email"`
}
InviteRequest holds the fields that should be included on a request to the `/invite` endpoint
func (*InviteRequest) Validate ¶
func (r *InviteRequest) Validate() error
Validate ensures the required fields are set on the InviteRequest request
type LoginReply ¶
LoginReply holds the response to LoginRequest
type LoginRequest ¶
type LoginRequest struct { Username string `json:"username" description:"The email address associated with the existing account" example:"jsnow@example.com"` Password string `json:"password" description:"The password associated with the account" example:"Wint3rIsC0ming123!"` }
LoginRequest holds the login payload for the /login route
func (*LoginRequest) Validate ¶
func (r *LoginRequest) Validate() error
Validate ensures the required fields are set on the LoginRequest request
type OauthTokenRequest ¶
type OauthTokenRequest struct { Name string `json:"name" description:"The name of the user" example:"Jon Snow"` Email string `json:"email" description:"The email address of the user" example:"jsnow@example.com"` AuthProvider string `json:"authProvider" description:"The provider used to authenticate the user, e.g. google, github, etc." example:"google"` ExternalUserID string `json:"externalUserId" description:"The ID of the user from the external provider" example:"1234567890"` ExternalUserName string `json:"externalUserName" description:"The username of the user from the external provider" example:"jsnow"` ClientToken string `json:"clientToken" description:"The token provided by the external provider"` Image string `json:"image,omitempty" description:"The image URL of the user from the external provider"` }
OauthTokenRequest to authenticate an oauth user with the Server
type Price ¶ added in v0.6.7
type Price struct { // Amount is the dollar amount of the price (e.g 100) Amount float64 `json:"amount"` // Interval is the interval of the price (e.g monthly, yearly) Interval string `json:"interval"` // Currency is the currency of the price that is being charged (e.g USD) Currency string `json:"currency"` }
Price is a custom type for pricing data
func (Price) MarshalGQL ¶ added in v0.6.7
MarshalGQL implement the Marshaler interface for gqlgen
func (*Price) UnmarshalGQL ¶ added in v0.6.7
UnmarshalGQL implement the Unmarshaler interface for gqlgen
type RefreshReply ¶
RefreshReply holds the fields that are sent on a response to the `/refresh` endpoint
type RefreshRequest ¶
type RefreshRequest struct {
RefreshToken string `json:"refresh_token" description:"The token to be used to refresh the access token after expiration"`
}
RefreshRequest holds the fields that should be included on a request to the `/refresh` endpoint
func (*RefreshRequest) Validate ¶
func (r *RefreshRequest) Validate() error
Validate ensures the required fields are set on the RefreshRequest request
type RegisterReply ¶
type RegisterReply struct { rout.Reply ID string `json:"user_id" description:"The ID of the user that was created" example:"01J4EXD5MM60CX4YNYN0DEE3Y1"` Email string `json:"email" description:"The email address of the user" example:"jsnow@example.com"` Message string `json:"message"` Token string `json:"token,omitempty" exclude:"true"` // only used for requests against local development, excluded from OpenAPI documentation }
RegisterReply holds the fields that are sent on a response to the `/register` endpoint
type RegisterRequest ¶
type RegisterRequest struct { FirstName string `json:"first_name,omitempty" description:"The first name of the user" example:"Jon"` LastName string `json:"last_name,omitempty" description:"The last name of the user" example:"Snow"` Email string `json:"email" description:"The email address of the user" example:"jsnow@example.com"` Password string `json:"password" description:"The password to be used for authentication after registration" example:"Wint3rIsC0ming123!"` }
RegisterRequest holds the fields that should be included on a request to the `/register` endpoint
func (*RegisterRequest) Validate ¶
func (r *RegisterRequest) Validate() error
Validate ensures the required fields are set on the RegisterRequest request
type ResendReply ¶
ResendReply holds the fields that are sent on a response to the `/resend` endpoint
type ResendRequest ¶
type ResendRequest struct {
Email string `` /* 134-byte string literal not displayed */
}
ResendRequest contains fields for a resend email verification request to the `/resend` endpoint
func (*ResendRequest) Validate ¶
func (r *ResendRequest) Validate() error
Validate ensures the required fields are set on the ResendRequest request
type ResetPasswordReply ¶
ResetPasswordReply is the response returned from a non-successful password reset request on success, no content is returned (204)
type ResetPasswordRequest ¶
type ResetPasswordRequest struct { Password string `json:"password" description:"The new password to be used for authentication"` Token string `json:"token" description:"The token to be used to reset the password, token is sent via email"` }
ResetPasswordRequest contains user input required to reset a user's password using /password-reset endpoint
func (*ResetPasswordRequest) Validate ¶
func (r *ResetPasswordRequest) Validate() error
Validate ensures the required fields are set on the ResetPasswordRequest request
type SwitchOrganizationReply ¶
SwitchOrganizationReply holds the new authentication and session information for the user for the new organization
type SwitchOrganizationRequest ¶
type SwitchOrganizationRequest struct {
TargetOrganizationID string `json:"target_organization_id" description:"The ID of the organization to switch to" example:"01J4EXD5MM60CX4YNYN0DEE3Y1"`
}
SwitchOrganizationRequest contains the target organization ID being switched to for the /switch endpoint
func (*SwitchOrganizationRequest) Validate ¶
func (r *SwitchOrganizationRequest) Validate() error
Validate ensures the required fields are set on the SwitchOrganizationRequest request
type TFARequest ¶ added in v0.6.11
type TFARequest struct { TOTPCode string `` /* 127-byte string literal not displayed */ RecoveryCode string `` /* 133-byte string literal not displayed */ }
TFARequest holds the payload for verifying the 2fa code (/2fa/validate)
func (*TFARequest) Validate ¶ added in v0.6.11
func (r *TFARequest) Validate() error
Validate ensures the required fields are set on the TFARequest request
type UploadFilesReply ¶ added in v0.3.0
type UploadFilesReply struct { rout.Reply Message string `json:"message,omitempty"` FileCount int64 `json:"file_count,omitempty" description:"The number of files uploaded"` Files []File `json:"files,omitempty" description:"The files that were uploaded"` }
UploadFilesReply holds the fields that are sent on a response to the `/upload` endpoint
type UploadFilesRequest ¶ added in v0.3.0
type UploadFilesRequest struct {
UploadFile multipart.FileHeader `form:"uploadFile" description:"The file to be uploaded"`
}
UploadFilesRequest holds the fields that should be included on a request to the `/upload` endpoint
type VerifyReply ¶
type VerifyReply struct { rout.Reply ID string `json:"user_id" description:"The ID of the user that was created" example:"01J4EXD5MM60CX4YNYN0DEE3Y1"` Email string `json:"email" description:"The email address of the user" example:"jsnow@example.com"` Message string `json:"message,omitempty"` AuthData }
VerifyReply holds the fields that are sent on a response to the `/verify` endpoint
type VerifyRequest ¶
type VerifyRequest struct {
Token string `query:"token" description:"The token to be used to verify the email address, token is sent via email"`
}
VerifyRequest holds the fields that should be included on a request to the `/verify` endpoint
func (*VerifyRequest) Validate ¶
func (r *VerifyRequest) Validate() error
Validate ensures the required fields are set on the VerifyRequest request
type VerifySubscribeReply ¶
VerifySubscribeReply holds the fields that are sent on a response to the `/subscribe/verify` endpoint
type VerifySubscribeRequest ¶
type VerifySubscribeRequest struct {
Token string `query:"token" description:"The token to be used to verify the subscription, token is sent via email"`
}
VerifySubscribeRequest holds the fields that should be included on a request to the `/subscribe/verify` endpoint
func (*VerifySubscribeRequest) Validate ¶
func (r *VerifySubscribeRequest) Validate() error
Validate ensures the required fields are set on the VerifySubscribeRequest request
type WebauthnBeginLoginResponse ¶
type WebauthnBeginLoginResponse struct { Reply rout.Reply *protocol.CredentialAssertion Session string `json:"session,omitempty"` }
WebauthnBeginLoginResponse is the response to begin a webauthn login this includes the credential assertion options and the session token
type WebauthnBeginRegistrationResponse ¶
type WebauthnBeginRegistrationResponse struct { Reply rout.Reply *protocol.CredentialCreation Session string `json:"session,omitempty"` }
WebauthnBeginRegistrationResponse is the response to begin a webauthn login this includes the credential creation options and the session token
type WebauthnLoginResponse ¶
WebauthnLoginResponse is the response after a successful webauthn login
type WebauthnRegistrationRequest ¶
type WebauthnRegistrationRequest struct { Email string `json:"email" description:"The email address associated with the account" example:"jsnow@example.com"` Name string `json:"name" description:"The name of the user" example:"Jon Snow"` }
WebauthnRegistrationRequest is the request to begin a webauthn login
func (*WebauthnRegistrationRequest) Validate ¶ added in v0.6.12
func (r *WebauthnRegistrationRequest) Validate() error