user

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActionTypeChoices added in v0.3.0

func ActionTypeChoices() []string

func AnyTypeChoices added in v0.3.0

func AnyTypeChoices() []string

func AuthenticationMethodStateTypeChoices added in v0.3.0

func AuthenticationMethodStateTypeChoices() []string

func MethodTypeChoices added in v0.3.0

func MethodTypeChoices() []string

Types

type AccessTokenCreateIn

type AccessTokenCreateIn struct {
	Description    string    `json:"description"`
	ExtendWhenUsed *bool     `json:"extend_when_used,omitempty"`
	MaxAgeSeconds  *float64  `json:"max_age_seconds,omitempty"`
	Scopes         *[]string `json:"scopes,omitempty"`
}

type AccessTokenCreateOut

type AccessTokenCreateOut struct {
	CreateTime                 time.Time  `json:"create_time"`
	CreatedManually            bool       `json:"created_manually"`
	CurrentlyActive            *bool      `json:"currently_active,omitempty"`
	Description                string     `json:"description,omitempty"`
	ExpiryTime                 *time.Time `json:"expiry_time,omitempty"`
	ExtendWhenUsed             bool       `json:"extend_when_used"`
	FullToken                  string     `json:"full_token"`
	LastIp                     string     `json:"last_ip,omitempty"`
	LastUsedTime               *time.Time `json:"last_used_time,omitempty"`
	LastUserAgent              string     `json:"last_user_agent,omitempty"`
	LastUserAgentHumanReadable string     `json:"last_user_agent_human_readable,omitempty"`
	MaxAgeSeconds              float64    `json:"max_age_seconds"`
	Scopes                     []string   `json:"scopes,omitempty"`
	TokenPrefix                string     `json:"token_prefix"`
}

type AccessTokenUpdateIn

type AccessTokenUpdateIn struct {
	Description string `json:"description"`
}

type AccessTokenUpdateOut

type AccessTokenUpdateOut struct {
	CreateTime                 time.Time  `json:"create_time"`
	CreatedManually            *bool      `json:"created_manually,omitempty"`
	CurrentlyActive            *bool      `json:"currently_active,omitempty"`
	Description                string     `json:"description,omitempty"`
	ExpiryTime                 *time.Time `json:"expiry_time,omitempty"`
	ExtendWhenUsed             bool       `json:"extend_when_used"`
	LastIp                     string     `json:"last_ip,omitempty"`
	LastUsedTime               *time.Time `json:"last_used_time,omitempty"`
	LastUserAgent              string     `json:"last_user_agent,omitempty"`
	LastUserAgentHumanReadable string     `json:"last_user_agent_human_readable,omitempty"`
	MaxAgeSeconds              float64    `json:"max_age_seconds"`
	Scopes                     []string   `json:"scopes,omitempty"`
	TokenPrefix                string     `json:"token_prefix"`
}

type AccountInviteOut

type AccountInviteOut struct {
	AccountId          string    `json:"account_id"`
	AccountName        string    `json:"account_name"`
	CreateTime         time.Time `json:"create_time"`
	InvitedByUserEmail string    `json:"invited_by_user_email"`
	TeamId             string    `json:"team_id"`
	TeamName           string    `json:"team_name"`
	UserEmail          string    `json:"user_email"`
}

type ActionType added in v0.3.0

type ActionType string
const (
	ActionTypeAzureOauth  ActionType = "azure_oauth"
	ActionTypeGithubOauth ActionType = "github_oauth"
	ActionTypeGoogleOauth ActionType = "google_oauth"
	ActionTypeHasuraOauth ActionType = "hasura_oauth"
	ActionTypePassword    ActionType = "password"
	ActionTypeSaml        ActionType = "saml"
	ActionTypeSignup      ActionType = "signup"
)

type AnyType added in v0.3.0

type AnyType string
const (
	AnyTypeAdmin     AnyType = "admin"
	AnyTypeDeveloper AnyType = "developer"
	AnyTypeOperator  AnyType = "operator"
	AnyTypeReadOnly  AnyType = "read_only"
)

type AuthenticationMethodOut

type AuthenticationMethodOut struct {
	AuthenticationMethodAccountId string                        `json:"authentication_method_account_id"`
	CreateTime                    time.Time                     `json:"create_time"`
	CurrentlyActive               bool                          `json:"currently_active"`
	DeleteTime                    time.Time                     `json:"delete_time"`
	LastUsedTime                  time.Time                     `json:"last_used_time"`
	MethodId                      string                        `json:"method_id"`
	Name                          string                        `json:"name,omitempty"`
	PublicRemoteIdentity          string                        `json:"public_remote_identity"`
	RemoteProviderId              string                        `json:"remote_provider_id"`
	State                         AuthenticationMethodStateType `json:"state"`
	UpdateTime                    time.Time                     `json:"update_time"`
	UserEmail                     string                        `json:"user_email"`
}

type AuthenticationMethodStateType added in v0.3.0

type AuthenticationMethodStateType string
const (
	AuthenticationMethodStateTypeActive  AuthenticationMethodStateType = "active"
	AuthenticationMethodStateTypeDeleted AuthenticationMethodStateType = "deleted"
)

type CheckPasswordStrengthExistingUserIn

type CheckPasswordStrengthExistingUserIn struct {
	NewPassword string `json:"new_password"`
	OldPassword string `json:"old_password"`
}

type CheckPasswordStrengthExistingUserOut

type CheckPasswordStrengthExistingUserOut struct {
	IsAcceptable *bool  `json:"is_acceptable,omitempty"`
	Message      string `json:"message"`
	Score        int    `json:"score"`
}

type CheckPasswordStrengthNewUserIn

type CheckPasswordStrengthNewUserIn struct {
	Email    string `json:"email,omitempty"`
	Password string `json:"password"`
	RealName string `json:"real_name,omitempty"`
}

type CheckPasswordStrengthNewUserOut

type CheckPasswordStrengthNewUserOut struct {
	IsAcceptable *bool  `json:"is_acceptable,omitempty"`
	Message      string `json:"message"`
	Score        int    `json:"score"`
}

type Handler

type Handler interface {
	// AccessTokenCreate create new access token
	// POST /v1/access_token
	// https://api.aiven.io/doc/#tag/Users/operation/AccessTokenCreate
	AccessTokenCreate(ctx context.Context, in *AccessTokenCreateIn) (*AccessTokenCreateOut, error)

	// AccessTokenList list all valid access tokens
	// GET /v1/access_token
	// https://api.aiven.io/doc/#tag/Users/operation/AccessTokenList
	AccessTokenList(ctx context.Context) ([]TokenOut, error)

	// AccessTokenRevoke revoke an access token
	// DELETE /v1/access_token/{token_prefix}
	// https://api.aiven.io/doc/#tag/Users/operation/AccessTokenRevoke
	AccessTokenRevoke(ctx context.Context, tokenPrefix string) error

	// AccessTokenUpdate update an existing access token
	// PUT /v1/access_token/{token_prefix}
	// https://api.aiven.io/doc/#tag/Users/operation/AccessTokenUpdate
	AccessTokenUpdate(ctx context.Context, tokenPrefix string, in *AccessTokenUpdateIn) (*AccessTokenUpdateOut, error)

	// CheckPasswordStrengthExistingUser check password strength for an existing user
	// POST /v1/me/password_strength
	// https://api.aiven.io/doc/#tag/Users/operation/CheckPasswordStrengthExistingUser
	CheckPasswordStrengthExistingUser(ctx context.Context, in *CheckPasswordStrengthExistingUserIn) (*CheckPasswordStrengthExistingUserOut, error)

	// CheckPasswordStrengthNewUser check password strength for a new user
	// POST /v1/user/password_strength
	// https://api.aiven.io/doc/#tag/Users/operation/CheckPasswordStrengthNewUser
	CheckPasswordStrengthNewUser(ctx context.Context, in *CheckPasswordStrengthNewUserIn) (*CheckPasswordStrengthNewUserOut, error)

	// OrganizationMemberGroupsList list user groups of the organization's member
	// GET /v1/organization/{organization_id}/user/{member_user_id}/user-groups
	// https://api.aiven.io/doc/#tag/Users/operation/OrganizationMemberGroupsList
	OrganizationMemberGroupsList(ctx context.Context, organizationId string, memberUserId string) ([]UserGroupOut, error)

	// TwoFactorAuthConfigure configure two-factor authentication
	// PUT /v1/me/2fa
	// https://api.aiven.io/doc/#tag/Users/operation/TwoFactorAuthConfigure
	TwoFactorAuthConfigure(ctx context.Context, in *TwoFactorAuthConfigureIn) (*TwoFactorAuthConfigureOut, error)

	// TwoFactorAuthConfigureOTP complete one-time password configuration
	// PUT /v1/me/2fa/otp
	// https://api.aiven.io/doc/#tag/Users/operation/TwoFactorAuthConfigureOTP
	TwoFactorAuthConfigureOTP(ctx context.Context, in *TwoFactorAuthConfigureOtpIn) (*TwoFactorAuthConfigureOtpOut, error)

	// UserAccountInvitesAccept accept all invites for a single account
	// POST /v1/me/account/invites/accept
	// https://api.aiven.io/doc/#tag/Users/operation/UserAccountInvitesAccept
	UserAccountInvitesAccept(ctx context.Context, in *UserAccountInvitesAcceptIn) ([]AccountInviteOut, error)

	// UserAccountInvitesList list pending account invites
	// GET /v1/me/account/invites
	// https://api.aiven.io/doc/#tag/Users/operation/UserAccountInvitesList
	UserAccountInvitesList(ctx context.Context) ([]AccountInviteOut, error)

	// UserAuth authenticate user
	// POST /v1/userauth
	// https://api.aiven.io/doc/#tag/Users/operation/UserAuth
	UserAuth(ctx context.Context, in *UserAuthIn) (*UserAuthOut, error)

	// UserAuthLoginOptions get available login options
	// POST /v1/userauth/login_options
	// https://api.aiven.io/doc/#tag/Users/operation/UserAuthLoginOptions
	UserAuthLoginOptions(ctx context.Context, in *UserAuthLoginOptionsIn) (*UserAuthLoginOptionsOut, error)

	// UserAuthenticationMethodDelete delete linked authentication method, and revoke all associated access tokens
	// DELETE /v1/me/authentication_methods/{user_authentication_method_id}
	// https://api.aiven.io/doc/#tag/Users/operation/UserAuthenticationMethodDelete
	UserAuthenticationMethodDelete(ctx context.Context, userAuthenticationMethodId string) error

	// UserAuthenticationMethodsList list linked authentication methods
	// GET /v1/me/authentication_methods
	// https://api.aiven.io/doc/#tag/Users/operation/UserAuthenticationMethodsList
	UserAuthenticationMethodsList(ctx context.Context) ([]AuthenticationMethodOut, error)

	// UserExpireTokens expire all authorization tokens
	// POST /v1/me/expire_tokens
	// https://api.aiven.io/doc/#tag/Users/operation/UserExpireTokens
	UserExpireTokens(ctx context.Context) error

	// UserInfo get information for the current session's user
	// GET /v1/me
	// https://api.aiven.io/doc/#tag/Users/operation/UserInfo
	UserInfo(ctx context.Context) (*UserInfoOut, error)

	// UserLogout logout user, removing current authentication token
	// POST /v1/me/logout
	// https://api.aiven.io/doc/#tag/Users/operation/UserLogout
	UserLogout(ctx context.Context) error

	// UserPasswordChange change user password
	// PUT /v1/me/password
	// https://api.aiven.io/doc/#tag/Users/operation/UserPasswordChange
	UserPasswordChange(ctx context.Context, in *UserPasswordChangeIn) (string, error)

	// UserPasswordReset confirm user password reset
	// POST /v1/user/password_reset/{verification_code}
	// https://api.aiven.io/doc/#tag/Users/operation/UserPasswordReset
	UserPasswordReset(ctx context.Context, verificationCode string, in *UserPasswordResetIn) error

	// UserPasswordResetRequest request user password reset
	// POST /v1/user/password_reset_request
	// https://api.aiven.io/doc/#tag/Users/operation/UserPasswordResetRequest
	UserPasswordResetRequest(ctx context.Context, in *UserPasswordResetRequestIn) error

	// UserUpdate edit profile
	// PATCH /v1/me
	// https://api.aiven.io/doc/#tag/Users/operation/UserUpdate
	UserUpdate(ctx context.Context, in *UserUpdateIn) (*UserUpdateOut, error)

	// UserVerifyEmail confirm user email address
	// POST /v1/user/verify_email/{verification_code}
	// https://api.aiven.io/doc/#tag/Users/operation/UserVerifyEmail
	UserVerifyEmail(ctx context.Context, verificationCode string) (*UserVerifyEmailOut, error)

	// ValidateCreditCode validate campaign credit code
	// GET /v1/user/credit_code/{credit_code}
	// https://api.aiven.io/doc/#tag/Users/operation/ValidateCreditCode
	ValidateCreditCode(ctx context.Context, creditCode string) error

	// ValidateReferralCode validate referral_code code
	// GET /v1/me/referral/validation/{referral_code}
	// https://api.aiven.io/doc/#tag/Users/operation/ValidateReferralCode
	ValidateReferralCode(ctx context.Context, referralCode string) error
}

type IntercomOut

type IntercomOut struct {
	AppId string `json:"app_id"`
	Hmac  string `json:"hmac"`
}

type InvitationOut

type InvitationOut struct {
	InviteCode        string    `json:"invite_code"`
	InviteTime        time.Time `json:"invite_time"`
	InvitingUserEmail string    `json:"inviting_user_email"`
	ProjectName       string    `json:"project_name"`
}

type MethodType added in v0.3.0

type MethodType string
const (
	MethodTypePost MethodType = "POST"
	MethodTypeGet  MethodType = "GET"
)

type ProjectMembershipOut

type ProjectMembershipOut struct {
	Any AnyType `json:"ANY,omitempty"`
}

type ProjectMembershipsOut

type ProjectMembershipsOut struct {
	Any []string `json:"ANY,omitempty"`
}

type TokenOut

type TokenOut struct {
	CreateTime                 time.Time  `json:"create_time"`
	CreatedManually            bool       `json:"created_manually"`
	CurrentlyActive            *bool      `json:"currently_active,omitempty"`
	Description                string     `json:"description,omitempty"`
	ExpiryTime                 *time.Time `json:"expiry_time,omitempty"`
	ExtendWhenUsed             bool       `json:"extend_when_used"`
	LastIp                     string     `json:"last_ip,omitempty"`
	LastUsedTime               *time.Time `json:"last_used_time,omitempty"`
	LastUserAgent              string     `json:"last_user_agent,omitempty"`
	LastUserAgentHumanReadable string     `json:"last_user_agent_human_readable,omitempty"`
	MaxAgeSeconds              float64    `json:"max_age_seconds"`
	Scopes                     []string   `json:"scopes,omitempty"`
	TokenPrefix                string     `json:"token_prefix"`
}

type TwoFactorAuthConfigureIn

type TwoFactorAuthConfigureIn struct {
	Method   string `json:"method"`
	Password string `json:"password"`
}

type TwoFactorAuthConfigureOtpIn

type TwoFactorAuthConfigureOtpIn struct {
	Otp      string `json:"otp"`
	Password string `json:"password"`
	Uri      string `json:"uri"`
}

type TwoFactorAuthConfigureOtpOut

type TwoFactorAuthConfigureOtpOut struct {
	Method string `json:"method"`
	Token  string `json:"token"`
}

type TwoFactorAuthConfigureOut

type TwoFactorAuthConfigureOut struct {
	Method string `json:"method"`
	Qrcode string `json:"qrcode,omitempty"`
	Uri    string `json:"uri,omitempty"`
}

type UserAccountInvitesAcceptIn

type UserAccountInvitesAcceptIn struct {
	AccountId string `json:"account_id"`
	TeamId    string `json:"team_id,omitempty"`
}

type UserAuthIn

type UserAuthIn struct {
	Email    string `json:"email"`
	Otp      string `json:"otp,omitempty"`
	Password string `json:"password"`
}

type UserAuthLoginOptionsIn

type UserAuthLoginOptionsIn struct {
	Email string `json:"email,omitempty"`
}

type UserAuthLoginOptionsOut

type UserAuthLoginOptionsOut struct {
	None        []map[string]any `json:"None,omitempty"`
	Action      ActionType       `json:"action"`
	Method      MethodType       `json:"method,omitempty"`
	Name        string           `json:"name,omitempty"`
	RedirectUrl string           `json:"redirect_url,omitempty"`
}

type UserAuthOut

type UserAuthOut struct {
	ReturnUrl string `json:"return_url,omitempty"`
	State     string `json:"state"`
	Token     string `json:"token"`
	UserEmail string `json:"user_email"`
}

type UserGroupOut

type UserGroupOut struct {
	CreateTime    time.Time `json:"create_time"`
	Description   string    `json:"description"`
	ManagedByScim bool      `json:"managed_by_scim"`
	UpdateTime    time.Time `json:"update_time"`
	UserGroupId   string    `json:"user_group_id"`
	UserGroupName string    `json:"user_group_name"`
}

type UserHandler

type UserHandler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(doer doer) UserHandler

func (*UserHandler) AccessTokenCreate

func (h *UserHandler) AccessTokenCreate(ctx context.Context, in *AccessTokenCreateIn) (*AccessTokenCreateOut, error)

func (*UserHandler) AccessTokenList

func (h *UserHandler) AccessTokenList(ctx context.Context) ([]TokenOut, error)

func (*UserHandler) AccessTokenRevoke

func (h *UserHandler) AccessTokenRevoke(ctx context.Context, tokenPrefix string) error

func (*UserHandler) AccessTokenUpdate

func (h *UserHandler) AccessTokenUpdate(ctx context.Context, tokenPrefix string, in *AccessTokenUpdateIn) (*AccessTokenUpdateOut, error)

func (*UserHandler) CheckPasswordStrengthNewUser

func (*UserHandler) OrganizationMemberGroupsList

func (h *UserHandler) OrganizationMemberGroupsList(ctx context.Context, organizationId string, memberUserId string) ([]UserGroupOut, error)

func (*UserHandler) TwoFactorAuthConfigure

func (h *UserHandler) TwoFactorAuthConfigure(ctx context.Context, in *TwoFactorAuthConfigureIn) (*TwoFactorAuthConfigureOut, error)

func (*UserHandler) TwoFactorAuthConfigureOTP

func (h *UserHandler) TwoFactorAuthConfigureOTP(ctx context.Context, in *TwoFactorAuthConfigureOtpIn) (*TwoFactorAuthConfigureOtpOut, error)

func (*UserHandler) UserAccountInvitesAccept

func (h *UserHandler) UserAccountInvitesAccept(ctx context.Context, in *UserAccountInvitesAcceptIn) ([]AccountInviteOut, error)

func (*UserHandler) UserAccountInvitesList

func (h *UserHandler) UserAccountInvitesList(ctx context.Context) ([]AccountInviteOut, error)

func (*UserHandler) UserAuth

func (h *UserHandler) UserAuth(ctx context.Context, in *UserAuthIn) (*UserAuthOut, error)

func (*UserHandler) UserAuthLoginOptions

func (h *UserHandler) UserAuthLoginOptions(ctx context.Context, in *UserAuthLoginOptionsIn) (*UserAuthLoginOptionsOut, error)

func (*UserHandler) UserAuthenticationMethodDelete

func (h *UserHandler) UserAuthenticationMethodDelete(ctx context.Context, userAuthenticationMethodId string) error

func (*UserHandler) UserAuthenticationMethodsList

func (h *UserHandler) UserAuthenticationMethodsList(ctx context.Context) ([]AuthenticationMethodOut, error)

func (*UserHandler) UserExpireTokens

func (h *UserHandler) UserExpireTokens(ctx context.Context) error

func (*UserHandler) UserInfo

func (h *UserHandler) UserInfo(ctx context.Context) (*UserInfoOut, error)

func (*UserHandler) UserLogout

func (h *UserHandler) UserLogout(ctx context.Context) error

func (*UserHandler) UserPasswordChange

func (h *UserHandler) UserPasswordChange(ctx context.Context, in *UserPasswordChangeIn) (string, error)

func (*UserHandler) UserPasswordReset

func (h *UserHandler) UserPasswordReset(ctx context.Context, verificationCode string, in *UserPasswordResetIn) error

func (*UserHandler) UserPasswordResetRequest

func (h *UserHandler) UserPasswordResetRequest(ctx context.Context, in *UserPasswordResetRequestIn) error

func (*UserHandler) UserUpdate

func (h *UserHandler) UserUpdate(ctx context.Context, in *UserUpdateIn) (*UserUpdateOut, error)

func (*UserHandler) UserVerifyEmail

func (h *UserHandler) UserVerifyEmail(ctx context.Context, verificationCode string) (*UserVerifyEmailOut, error)

func (*UserHandler) ValidateCreditCode

func (h *UserHandler) ValidateCreditCode(ctx context.Context, creditCode string) error

func (*UserHandler) ValidateReferralCode

func (h *UserHandler) ValidateReferralCode(ctx context.Context, referralCode string) error

type UserInfoOut

type UserInfoOut struct {
	Auth                   []string               `json:"auth"`
	City                   string                 `json:"city,omitempty"`
	Country                string                 `json:"country,omitempty"`
	CreateTime             *time.Time             `json:"create_time,omitempty"`
	Department             string                 `json:"department,omitempty"`
	Features               map[string]any         `json:"features,omitempty"`
	Intercom               IntercomOut            `json:"intercom"`
	Invitations            []InvitationOut        `json:"invitations"`
	JobTitle               string                 `json:"job_title,omitempty"`
	ManagedByScim          *bool                  `json:"managed_by_scim,omitempty"`
	ManagingOrganizationId string                 `json:"managing_organization_id,omitempty"`
	ProjectMembership      ProjectMembershipOut   `json:"project_membership"`
	ProjectMemberships     *ProjectMembershipsOut `json:"project_memberships,omitempty"`
	Projects               []string               `json:"projects"`
	RealName               string                 `json:"real_name"`
	State                  string                 `json:"state"`
	TokenValidityBegin     string                 `json:"token_validity_begin,omitempty"`
	User                   string                 `json:"user"`
	UserId                 string                 `json:"user_id"`
}

type UserPasswordChangeIn

type UserPasswordChangeIn struct {
	NewPassword string `json:"new_password"`
	Password    string `json:"password"`
}

type UserPasswordResetIn

type UserPasswordResetIn struct {
	NewPassword string `json:"new_password"`
}

type UserPasswordResetRequestIn

type UserPasswordResetRequestIn struct {
	Email string `json:"email"`
}

type UserUpdateIn

type UserUpdateIn struct {
	City       string `json:"city,omitempty"`
	Country    string `json:"country,omitempty"`
	Department string `json:"department,omitempty"`
	JobTitle   string `json:"job_title,omitempty"`
	RealName   string `json:"real_name"`
}

type UserUpdateOut

type UserUpdateOut struct {
	Auth                   []string               `json:"auth"`
	City                   string                 `json:"city,omitempty"`
	Country                string                 `json:"country,omitempty"`
	CreateTime             *time.Time             `json:"create_time,omitempty"`
	Department             string                 `json:"department,omitempty"`
	Features               map[string]any         `json:"features,omitempty"`
	Intercom               IntercomOut            `json:"intercom"`
	Invitations            []InvitationOut        `json:"invitations"`
	JobTitle               string                 `json:"job_title,omitempty"`
	ManagedByScim          *bool                  `json:"managed_by_scim,omitempty"`
	ManagingOrganizationId string                 `json:"managing_organization_id,omitempty"`
	ProjectMembership      ProjectMembershipOut   `json:"project_membership"`
	ProjectMemberships     *ProjectMembershipsOut `json:"project_memberships,omitempty"`
	Projects               []string               `json:"projects"`
	RealName               string                 `json:"real_name"`
	State                  string                 `json:"state"`
	TokenValidityBegin     string                 `json:"token_validity_begin,omitempty"`
	User                   string                 `json:"user"`
	UserId                 string                 `json:"user_id"`
}

type UserVerifyEmailOut

type UserVerifyEmailOut struct {
	UserEmail string `json:"user_email"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL