oauthDomain

package
v0.0.0-...-0bb06ad Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// StorageSessionName ...
	StorageSessionName = "go_oauth2_server_session"
	// UserSessionKey ...
	UserSessionKey = "go_oauth2_server_user"
	// ErrSessonNotStarted ...
	ErrSessonNotStarted = errors.New("Session not started")
)

Functions

This section is empty.

Types

type AccessToken

type AccessToken struct {
	Common
	ClientID  sql.NullString `db:"client_id"`
	UserID    sql.NullString `db:"user_id"`
	Client    *Client
	User      *Users
	Token     string    `sql:"token"`
	ExpiresAt time.Time `sql:"expires_at"`
	Scope     string    `sql:"scope"`
}

type AuthorizationCode

type AuthorizationCode struct {
	Common
	ClientID    sql.NullString `db:"client_id"`
	UserID      sql.NullString `db:"user_id"`
	Client      *Client
	User        *Users
	Code        string         `sql:"code"`
	RedirectURI sql.NullString `db:"redirect_uri"`
	ExpiresAt   time.Time      `sql:"expires_at"`
	Scope       string         `sql:"scope"`
}

type Client

type Client struct {
	Common
	Key         string         `db:"key" json:"key"`
	Secret      string         `db:"secret" json:"secret"`
	RedirectURI sql.NullString `db:"redirect_uri" json:"redirect_uri"`
}

type Common

type Common struct {
	ID        uuid.UUID  `db:"id"`
	CreatedAt time.Time  `db:"created_at"`
	UpdatedAt time.Time  `db:"updated_at"`
	DeletedAt *time.Time `db:"deleted_at"`
}

type EmailTokenModel

type EmailTokenModel struct {
	Common
	Reference   string     `db:"reference"`
	EmailSent   bool       `db:"email_sent"`
	EmailSentAt *time.Time `db:"email_sent_at"`
	ExpiresAt   time.Time  `db:"expires_at"`
}

type RefreshToken

type RefreshToken struct {
	Common
	ClientID  sql.NullString `db:"client_id"`
	UserID    sql.NullString `db:"user_id"`
	Client    *Client
	User      *Users
	Token     string    `sql:"token"`
	ExpiresAt time.Time `sql:"expires_at"`
	Scope     string    `sql:"scope"`
}

type Role

type Role struct {
	ID   uuid.UUID `db:"id" json:"id"`
	Name string    `db:"name" json:"name"`
	Timestamp
}

type Scope

type Scope struct {
	Common
	Scope       string `db:"scope" json:"scope"`
	Description string `db:"description" json:"desc"`
	IsDefault   bool   `db:"is_default"`
}

type Timestamp

type Timestamp struct {
	CreatedAt time.Time  `db:"created_at"`
	UpdatedAt time.Time  `db:"updated_at"`
	DeletedAt *time.Time `db:"deleted_at"`
}

type Token

type Token struct {
	Common
	ClientID  sql.NullString `db:"client_id"`
	UserID    sql.NullString `db:"user_id"`
	Client    *Client
	User      *Users
	Token     string    `sql:"token"`
	ExpiresAt time.Time `sql:"expires_at"`
	Scope     string    `sql:"scope"`
}

type UserSession

type UserSession struct {
	ClientID     string
	Username     string
	AccessToken  string
	RefreshToken string
}

type Users

type Users struct {
	Common
	RoleID   sql.NullString `db:"role_id" json:"role_id"`
	Role     *Role
	Username string         `db:"username" json:"username"`
	Password sql.NullString `db:"password" json:"password"`
}

Jump to

Keyboard shortcuts

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