model

package
v0.0.0-...-066019b Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Credentials

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

type Error

type Error = struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type LoginRequestParams

type LoginRequestParams struct {
	RequestedUrl string `json:"requested_url,omitempty"`
	Credentials
}

type PublicKeysResponse

type PublicKeysResponse struct {
	PublicKeys map[string]string `json:"public_keys"`
	Errors     []Error           `json:"errors"`
}

type RSAKeyIdentifier

type RSAKeyIdentifier struct {
	KID string `json:"kid"`
}

type RSAKeyPair

type RSAKeyPair struct {
	Public  *rsa.PublicKey
	Private *rsa.PrivateKey
}

type RefreshTokenClaims

type RefreshTokenClaims struct {
	Token string `json:"token"`
	RSAKeyIdentifier
	jwt.StandardClaims
}

type RegisterRequestParams

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

type TokenDelete

type TokenDelete struct {
	TokenId string `json:"token_id"`
}

type User

type User struct {
	ID    string `json:"id" bson:"_id"`
	Email string `json:"email" bson:"email"`
}

func DowngradeToUser

func DowngradeToUser(userWithCredentials UserWithCredentials) User

Should perhaps be moved to a helpers package?

type UserResponse

type UserResponse struct {
	User   User    `json:"user"`
	Errors []Error `json:"errors"`
}

type UserTokenClaims

type UserTokenClaims struct {
	UserId string `json:"user_id"`
	Name   string `json:"name"`
	Email  string `json:"email"`
	RSAKeyIdentifier
	jwt.StandardClaims
}

type UserWithCredentials

type UserWithCredentials struct {
	ID       string `bson:"_id,omitempty"`
	Email    string `bson:"email"`
	Password string `bson:"password"`
}

Jump to

Keyboard shortcuts

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