auth

package
v1.1.15 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetService

func SetService(svc Service)

func Signup

func Signup(ctx context.ServiceContext, client *clients.GQLClient, options *SignupOptions) error

func UpdatePassword

func UpdatePassword(ctx context.ServiceContext, client *clients.HTTPClient, options *UpdatePasswordOptions) error

Types

type DecryptKeysFromSessionOptions added in v1.1.7

type DecryptKeysFromSessionOptions struct {
	Password string `json:"password"`
	Session  map[string]interface{}
}

type DefaultService

type DefaultService struct{}

func (*DefaultService) DecryptKeysFromSession

func (*DefaultService) DecryptKeysFromSession(ctx context.ServiceContext, client *clients.GQLClient, options *DecryptKeysFromSessionOptions) (*keyCommons.Payload, error)

func (*DefaultService) GenerateTOTPQR

func (*DefaultService) RefreshToken added in v1.1.13

func (*DefaultService) SigninWithMFA

func (*DefaultService) SigninWithPAT added in v1.1.8

func (*DefaultService) SigninWithPassword

func (*DefaultService) ToggleMFA

func (*DefaultService) ToggleMFA(ctx context.ServiceContext, client *clients.NhostClient, options *ToggleMFAOptions) error

Remember: Passing a nil value to the "ActiveMFAType" option will deactivate MFA.

type GenerateQRResponse added in v1.1.7

type GenerateQRResponse struct {
	Secret string `json:"secret"`
	Image  string `json:"image"`
}

type MFAType added in v1.1.7

type MFAType string
const TOTP MFAType = "totp"

type NhostSession added in v1.1.7

type NhostSession struct {
	AccessToken  string `json:"accessToken"`
	RefreshToken string `json:"refreshToken"`
}

type NhostSigninResponse added in v1.1.7

type NhostSigninResponse struct {
	MFA     map[string]interface{} `json:"mfa"`
	Session map[string]interface{} `json:"session"`
}

type RefreshTokenOptions added in v1.1.13

type RefreshTokenOptions struct {
	RefreshToken string `json:"refreshToken"`
}

type RefreshTokenResponse added in v1.1.13

type RefreshTokenResponse struct {
	AccessToken  string     `json:"accessToken"`
	RefreshToken string     `json:"refreshToken"`
	User         users.User `json:"user"`
}

type SigninResponse added in v1.1.7

type SigninResponse struct {
	MFA     map[string]interface{} `json:"mfa"`
	Session map[string]interface{} `json:"session"`
	Keys    map[string]string      `json:"keys"`
}

type SigninWithMFAOptions added in v1.1.7

type SigninWithMFAOptions struct {
	OTP    string `json:"otp"`
	Ticket string `json:"ticket"`
}

func (*SigninWithMFAOptions) JSONMarshal added in v1.1.7

func (o *SigninWithMFAOptions) JSONMarshal() ([]byte, error)

Custom marshaller for the SigninWithMFAOptions.

type SigninWithPATOptions added in v1.1.8

type SigninWithPATOptions struct {
	PAT string `json:"personalAccessToken"`
}

type SigninWithPasswordOptions added in v1.1.7

type SigninWithPasswordOptions struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

type SignupOptions added in v1.1.7

type SignupOptions struct {
	Email    string `json:"email"`
	Password string `json:"password"`
	Name     string `json:"name"`
}

type ToggleMFAOptions added in v1.1.7

type ToggleMFAOptions struct {
	Code string `json:"code"`

	//	The value of "null" will deactivate MFA.
	ActiveMFAType MFAType `json:"activeMfaType"`
}

func (*ToggleMFAOptions) JSONMarshal added in v1.1.7

func (o *ToggleMFAOptions) JSONMarshal() ([]byte, error)

Custom marshaller for the ToggleMFAOptions.

type UpdatePasswordOptions added in v1.1.7

type UpdatePasswordOptions struct {
	NewPassword string `json:"newPassword,omitempty"`
	OldPassword string `json:"oldPassword,omitempty"`
}

Jump to

Keyboard shortcuts

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