auth

package
v0.0.0-...-05df700 Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AdminPosition      = "admin"
	ManagerPosition    = "manager"
	AccountantPosition = "accountant"
	WorkerPosition     = "worker"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountCreatedMessage

type AccountCreatedMessage struct {
	PublicId string `json:"public_id"`
	Email    string `json:"email"`
	Fullname string `json:"full_name"`
	Position string `json:"position"`
}

type AuthAccount

type AuthAccount struct {
	PublicId string `json:"public_id"`
	Email    string `json:"email"`
	Fullname string `json:"full_name"`
	Position string `json:"position"`
}

type AuthenticateResponse

type AuthenticateResponse struct {
	AuthAccount AuthAccount `json:"account"`
}

type BaseKafkaMessage

type BaseKafkaMessage struct {
	Type string `json:"type"`
	Data []byte `json:"data"`
}

type CreateAccountRequest

type CreateAccountRequest struct {
	Email    string `json:"email"`
	Password string `json:"password"`
	Fullname string `json:"full_name"`
	Position string `json:"position"`
}

type CreateAccountResponse

type CreateAccountResponse struct {
	AuthAccount AuthAccount `json:"account"`
}

type Service

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

func New

func New(authAccountsRepo *auth_accounts_repo.Repository) (*Service, error)

func (*Service) Authenticate

func (s *Service) Authenticate(ctx *gin.Context)

Authenticate godoc @Summary Authenticate @Description Authenticate @Tags auth @Accept json @Produce json @Success 200 {object} AuthenticateResponse @Router /api/v1/auth/authenticate [post] @Security BasicAuth

func (*Service) CreateAccount

func (s *Service) CreateAccount(ctx *gin.Context)

CreateTask godoc @Summary Create new auth account @Description Create new auth account @Tags accounts @Accept json @Produce json @Param ecu body CreateTaskRequest @Success 201 {object} CreateTaskResponse @Router /api/v1/auth/accounts [post]

func (*Service) SetupRoutes

func (s *Service) SetupRoutes(router gin.IRouter)

Jump to

Keyboard shortcuts

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