interfaces

package
v1.0.602 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Applications added in v0.0.3

type Applications interface {
	CountWithParams(enableTracing bool, ctx context.Context, req *auth.GetApplicationRequest) (count int64, err error)
	FindWithParams(enableTracing bool, ctx context.Context, req *auth.GetApplicationRequest) (res []*auth.ApplicationList, err error)
	FindByID(enableTracing bool, ctx context.Context, id string) (res []*auth.ApplicationList, err error)
	FindByName(enableTracing bool, ctx context.Context, params string) (res []*auth.ApplicationList, err error)
	FindByIDAndDefault(enableTracing bool, ctx context.Context, params string, def bool) (res []*auth.ApplicationList, err error)
	FindByDefault(enableTracing bool, ctx context.Context, params bool) (res []*auth.ApplicationList, err error)
	FindByMultipleIDAndDefault(enableTracing bool, ctx context.Context, param []string, def bool) (res []*auth.ApplicationList, err error)
	Create(enableTracing bool, ctx context.Context, req *auth.ApplicationList) (err error)
	Delete(enableTracing bool, ctx context.Context, data *auth.DeleteApplicationRequest) (err error)
	Update(enableTracing bool, ctx context.Context, req *auth.EditApplicationRequest) (err error)
	GetData(enableTracing bool, ctx context.Context, limit, skip int) (res []*auth.ApplicationList, err error)
	BulkInsert(enableTracing bool, ctx context.Context, req []*auth.ApplicationList) (err error)
}

type Auth

type Auth interface {
	Init(*AuthOption) error
	UseBasicToken(dir string) (err error)
	UseBasicTokenWithPreload(dir, token string) (err error)
	BasicTokenValidate(tok string) (err error)
	UseJWT() (jwt Services, err error)
	GetModels() Models
	GetStorage() Storage

	InsertLogs(enableTracing bool, ctx context.Context, data *auth.LogsList) error
	GetApplication(enableTracing bool, ctx context.Context, req *auth.GetApplicationRequest) (res *auth.GetApplicationResponse, err error)
	NewApplication(enableTracing bool, ctx context.Context, req *auth.NewApplicationRequest) (res *auth.ApplicationList, err error)
	DeleteApplication(enableTracing bool, ctx context.Context, req *auth.DeleteApplicationRequest) (res *emptypb.Empty, err error)
	EditApplication(enableTracing bool, ctx context.Context, req *auth.EditApplicationRequest) (res *emptypb.Empty, err error)
	NewScope(enableTracing bool, ctx context.Context, req *auth.ScopeList) (res *auth.ScopeList, err error)
	EditScope(enableTracing bool, ctx context.Context, req *auth.ScopeList) (err error)
	GetScopes(enableTracing bool, ctx context.Context, req *auth.GetScopesRequest) (res *auth.GetScopesResponse, err error)
	DeleteScope(enableTracing bool, ctx context.Context, req *auth.DeleteScopesRequest) (err error)
	NewUserGroup(enableTracing bool, ctx context.Context, req *auth.UsersGroupList) (res *auth.UsersGroupList, err error)
	NewUser(enableTracing bool, ctx context.Context, req *auth.NewUserRequest) (res *auth.UsersList, err error)
	GetUsersGroup(enableTracing bool, ctx context.Context, req *auth.GetUsersGroupRequest) (res *auth.GetUsersGroupResponse, err error)
	UserEdit(enableTracing bool, ctx context.Context, reqUser *auth.UsersList, req *auth.UserEditRequest) (res *auth.UsersList, err error)
	UserChangePassword(enableTracing bool, ctx context.Context, byPassCheckingOldPassword bool, reqUser *auth.UsersList, req *auth.ChangePasswordRequest, tokenId string) (res *auth.UsersList, err error)
	GenerateTwoFactorAuthUser(enableTracing bool, ctx context.Context, issuer string, req *auth.EnableTwoFactorAuthRequest) (res *auth.EnableTwoFactorAuthResponse, err error)
	UpdateSingleFieldUser(enableTracing bool, ctx context.Context, userID string, system bool, values map[string]interface{}) (err error)
	ValidateOTPConfig(secret string, code int32) (err error)
	EnableTwoFactorAuth(enableTracing bool, ctx context.Context, userID string, secret string, enable, terminatedOtherSession bool, tokenid string, system bool) (err error)
	DisableTwoFactorAuth(enableTracing bool, ctx context.Context, userID, tokenid string, system bool) (err error)
	AddUsersListGroups(enableTracing bool, ctx context.Context, req *auth.AddUsersListGroupsRequest) (err error)
	DelUsersListGroups(enableTracing bool, ctx context.Context, req *auth.DelUsersListGroupsRequest) (err error)
	GetUsersListGroups(enableTracing bool, ctx context.Context, req *auth.GetUsersListGroupsRequest) (res *auth.GetUsersListGroupsResponse, err error)
	FindGroupScopes(enableTracing bool, ctx context.Context, req *auth.GroupScopeInList) (res *auth.GroupScopeInList, err error)
	AddGroupScopes(enableTracing bool, ctx context.Context, req *auth.UsersGroupScopesListRequest) (err error)
	DelGroupScopes(enableTracing bool, ctx context.Context, req *auth.UsersGroupScopesListRequest) (err error)
	GetUsers(enableTracing bool, ctx context.Context, req *auth.GetUsersRequest) (res *auth.GetUsersResponse, err error)
	DeleteUser(enableTracing bool, ctx context.Context, reqUser *auth.UsersList, req *auth.UserDeleteRequest) (err error)
	DeleteUserGroup(enableTracing bool, ctx context.Context, req *auth.DeleteUserGroupRequest) (err error)
	GetUsersGroupScopes(enableTracing bool, ctx context.Context, req *auth.GetUsersGroupScopesRequest) (res *auth.GetUsersGroupScopesResponse, err error)
	FindUsersGroup(enableTracing bool, ctx context.Context, req *auth.UsersGroupInList) (res *auth.UsersGroupInList, err error)
	GetUsersGroupApplications(enableTracing bool, ctx context.Context, req *auth.GetUsersGroupApplicationsRequest) (res *auth.GetUsersGroupApplicationsResponse, err error)
	AddGroupApplications(enableTracing bool, ctx context.Context, req *auth.UsersGroupApplicationsListRequest) (err error)
	DelGroupApplications(enableTracing bool, ctx context.Context, req *auth.UsersGroupApplicationsListRequest) (err error)
	FindApplicationGroup(enableTracing bool, ctx context.Context, req *auth.ApplicationInList) (res *auth.ApplicationInList, err error)
	AddUserApplication(enableTracing bool, ctx context.Context, req *auth.AddUsersApplicationRequest) (err error)
	AddAuthCode(enableTracing bool, ctx context.Context, req *auth.AuthCodeList) (code string, err error)
	GetUsersApplications(enableTracing bool, ctx context.Context, req *auth.GetUsersApplicationRequest) (res *auth.GetUsersApplicationResponse, err error)
	DelUserApplication(enableTracing bool, ctx context.Context, req *auth.DelUsersApplicationRequest) (err error)
	TerminatedOthersSession(enableTracing bool, ctx context.Context, userID string, system bool, password, tokenId string) (err error)
}

type AuthCode added in v0.0.3

type AuthCode interface {
	FindByState(enableTracing bool, ctx context.Context, userId, state string) (res []*auth.AuthCodeList, err error)
	FindByCode(enableTracing bool, ctx context.Context, code string) (res []*auth.AuthCodeList, err error)
	Add(enableTracing bool, ctx context.Context, req *auth.AuthCodeList) (err error)
	Del(enableTracing bool, ctx context.Context, req *auth.AuthCodeList) (err error)
}

type AuthOption added in v0.0.3

type AuthOption struct {
	Logger                  logger.Logger               `validate:"required"`
	DB                      databaseInterfaces.Database `validate:"required"`
	DBPrimary               interface{}
	DBStorage               interface{}
	Tracing                 tracingInterface.Tracing
	Directory               string
	DisableMigrateDBOnStart bool
}

type Driver added in v0.0.8

type Driver struct {
	Name   string `yaml:"name" default:""`
	Driver string `yaml:"driver" default:""`
}

type JWtContext added in v0.0.3

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

func (*JWtContext) GetTokenData added in v0.0.3

func (c *JWtContext) GetTokenData() types.TokenData

func (*JWtContext) SetTokenData added in v0.0.3

func (c *JWtContext) SetTokenData(val types.TokenData)

type JwtExps added in v0.0.3

type JwtExps struct {
	Access  time.Duration
	Refresh time.Duration
}

type Logs added in v0.0.3

type Logs interface {
	Insert(enableTracing bool, ctx context.Context, req *auth.LogsList) (err error)
}

type Models added in v0.0.3

type Models interface {
	Init() (err error)
	Id() string
	Logs() Logs
	Applications() Applications
	Scopes() Scopes
	Users() Users
	UsersGroups() UsersGroups
	UsersGroupScopes() UsersGroupScopes
	UserListsGroups() UserListsGroups
	UsersGroupApplications() UsersGroupApplications
	UserListsApplications() UserListsApplications
}

type RequestContextType added in v0.0.3

type RequestContextType string
const RequestContextJwt RequestContextType = "RequestContextJwt"

type Scopes added in v0.0.3

type Scopes interface {
	GetData(enableTracing bool, ctx context.Context, limit, skip int) (res []*auth.ScopeList, err error)
	BulkInsert(enableTracing bool, ctx context.Context, req []*auth.ScopeList) (err error)
	CountWithParams(enableTracing bool, ctx context.Context, req *auth.GetScopesRequest) (count int64, err error)
	FindWithParams(enableTracing bool, ctx context.Context, req *auth.GetScopesRequest) (res []*auth.ScopeList, err error)
	FindByID(enableTracing bool, ctx context.Context, param string) (res []*auth.ScopeList, err error)
	FindByMultipleID(enableTracing bool, ctx context.Context, param []string) (res []*auth.ScopeList, err error)
	FindByMultipleIDAndDefault(enableTracing bool, ctx context.Context, param []string, def bool) (res []*auth.ScopeList, err error)
	FindByMethodsAndDefault(enableTracing bool, ctx context.Context, params []string, def bool) (res []*auth.ScopeList, err error)
	FindByMethodsAndDefaultAndTag(enableTracing bool, ctx context.Context, params []string, tag string, def bool) (res []*auth.ScopeList, err error)
	FindByMethodsAndDefaultAndTagAndEnable(enableTracing bool, ctx context.Context, params []string, tag string, def bool, enable bool) (res []*auth.ScopeList, err error)
	FindByMethodsAndDefaultAndIDAndEnable(enableTracing bool, ctx context.Context, method, ids []string, def, enable bool) (res []*auth.ScopeList, err error)
	FindIfExist(enableTracing bool, ctx context.Context, id, method string, param bool) (res []*auth.ScopeList, err error)
	Create(enableTracing bool, ctx context.Context, req *auth.ScopeList) (err error)
	Edit(enableTracing bool, ctx context.Context, req *auth.ScopeList) (err error)
	Delete(enableTracing bool, ctx context.Context, req *auth.DeleteScopesRequest) (err error)
	FindByDefault(enableTracing bool, ctx context.Context, isDefault bool) (res []*auth.ScopeList, err error)
	FindByDefaultAndTag(enableTracing bool, ctx context.Context, isDefault bool, tag []string) (res []*auth.ScopeList, err error)
	FindByMultipleIDAndDefaultAndTagAndMethod(enableTracing bool, ctx context.Context, id []string, isDefault bool, tag string, method string) (res []*auth.ScopeList, err error)
}

type Services added in v0.0.3

type Services interface {
	Session(enableTracing bool, ctx context.Context, req *auth.SessionRequest) (res *auth.SessionResponse, err error)
	Login(enableTracing bool, ctx context.Context, req *auth.UserLoginRequest) (res *auth.UserLoginResponse, err error)
	GenerateToken(enableTracing bool, ctx context.Context, req *auth.TokenRequestData) (signedToken *auth.UserLoginResponse, err error)
	RefreshToken(enableTracing bool, ctx context.Context, req *auth.RefreshTokenRequest) (res *auth.UserLoginResponse, err error)
	TerminatedSession(enableTracing bool, ctx context.Context, req *auth.SessionTerminatedRequest) (res *emptypb.Empty, err error)
	GetToken(enableTracing bool, ctx context.Context, req *auth.GetTokenRequest) (res *auth.GetTokenResponse, err error)
}

type Storage added in v0.0.8

type Storage interface {
	Init() (err error)
	Id() string
	Tokens() Tokens
	AuthCode() AuthCode
}

type Tables added in v0.0.3

type Tables interface {
	TableName() string
}

type Tokens added in v0.0.3

type Tokens interface {
	FindByID(enableTracing bool, ctx context.Context, param string) (res []*auth.TokenList, err error)
	GetToken(enableTracing bool, ctx context.Context, userid, id, appId string, withApp bool) (res types.TokenData, err error)
	InsertToken(enableTracing bool, ctx context.Context, req *auth.TokenList) (err error)
	DeleteToken(enableTracing bool, ctx context.Context, userid, id string) (err error)
	TerminateOtherTokens(enableTracing bool, ctx context.Context, userid, id string) (err error)
}

type UserListsApplications added in v0.0.3

type UserListsApplications interface {
	CountWithParams(enableTracing bool, ctx context.Context, req *auth.GetUsersApplicationRequest) (count int64, err error)
	FindWithParams(enableTracing bool, ctx context.Context, req *auth.GetUsersApplicationRequest) (res []*auth.UsersApplicationList, err error)
	FindByUserIDAndApplicationID(enableTracing bool, ctx context.Context, userID, applicationID string) (res []*auth.UsersApplicationList, err error)
	AddApplication(enableTracing bool, ctx context.Context, req *auth.UsersApplicationList) (err error)
	DelApplication(enableTracing bool, ctx context.Context, req *auth.UsersApplicationList) (err error)
	GetData(enableTracing bool, ctx context.Context, limit, skip int) (res []*auth.UsersApplicationList, err error)
	BulkInsert(enableTracing bool, ctx context.Context, req []*auth.UsersApplicationList) (err error)
}

type UserListsGroups added in v0.0.3

type UserListsGroups interface {
	FindByUserID(enableTracing bool, ctx context.Context, param string) (res []*auth.UsersListGroups, err error)
	FindByGroupID(enableTracing bool, ctx context.Context, groupID string) (res []*auth.UsersListGroups, err error)
	FindByUserIDAndGroupID(enableTracing bool, ctx context.Context, userID, groupID string) (res []*auth.UsersListGroups, err error)
	FindByUserIDAndMultipleGroupID(enableTracing bool, ctx context.Context, userID string, groupID []string) (res []*auth.UsersListGroups, err error)
	AddGroups(enableTracing bool, ctx context.Context, req *auth.UsersListGroups) (err error)
	DelGroups(enableTracing bool, ctx context.Context, req *auth.UsersListGroups) (err error)
	CountWithParams(enableTracing bool, ctx context.Context, req *auth.GetUsersListGroupsRequest) (count int64, err error)
	FindWithParams(enableTracing bool, ctx context.Context, req *auth.GetUsersListGroupsRequest) (res []*auth.UsersListGroups, err error)
	GetData(enableTracing bool, ctx context.Context, limit, skip int) (res []*auth.UsersListGroups, err error)
	BulkInsert(enableTracing bool, ctx context.Context, req []*auth.UsersListGroups) (err error)
}

type Users added in v0.0.3

type Users interface {
	CountWithParams(enableTracing bool, ctx context.Context, req *auth.GetUsersRequest) (count int64, err error)
	FindWithParams(enableTracing bool, ctx context.Context, req *auth.GetUsersRequest) (res []*auth.UsersList, err error)
	FindByID(enableTracing bool, ctx context.Context, param string) (res []*auth.UsersList, err error)
	FindByEmail(enableTracing bool, ctx context.Context, param string) (res []*auth.UsersList, err error)
	FindByUserName(enableTracing bool, ctx context.Context, param string) (res []*auth.UsersList, err error)
	FindBySystem(enableTracing bool, ctx context.Context, param bool) (res []*auth.UsersList, err error)
	FindByDefault(enableTracing bool, ctx context.Context, param bool) (res []*auth.UsersList, err error)
	FindByIDAndSystem(enableTracing bool, ctx context.Context, param string, system bool) (res []*auth.UsersList, err error)
	FindByDefaultAndSystem(enableTracing bool, ctx context.Context, param, system bool) (res []*auth.UsersList, err error)
	FindByEmailAndSystem(enableTracing bool, ctx context.Context, param string, system bool) (res []*auth.UsersList, err error)
	FindByUserNameAndSystem(enableTracing bool, ctx context.Context, param string, system bool) (res []*auth.UsersList, err error)
	Create(enableTracing bool, ctx context.Context, data *auth.UsersList) (err error)
	Update(enableTracing bool, ctx context.Context, data *auth.UsersList) (err error)
	UpdateById(enableTracing bool, ctx context.Context, userId string, updateData map[string]interface{}) (err error)
	Delete(enableTracing bool, ctx context.Context, data *auth.UsersList) (err error)
	CheckLogin(enableTracing bool, ctx context.Context, data *auth.UserLoginRequest, system bool) (res *auth.UsersList, err error)
	GetData(enableTracing bool, ctx context.Context, limit, skip int) (res []*auth.UsersList, err error)
	BulkInsert(enableTracing bool, ctx context.Context, req []*auth.UsersList) (err error)
}

type UsersGroupApplications added in v0.0.3

type UsersGroupApplications interface {
	CountWithParams(enableTracing bool, ctx context.Context, req *auth.GetUsersGroupApplicationsRequest) (count int64, err error)
	FindWithParams(enableTracing bool, ctx context.Context, req *auth.GetUsersGroupApplicationsRequest) (res []*auth.UsersGroupApplicationsList, err error)
	FindByMultipleGroupID(enableTracing bool, ctx context.Context, groupID []string) (res []*auth.UsersGroupApplicationsList, err error)
	FindByMultipleGroupIDAndApplicationID(enableTracing bool, ctx context.Context, groupID []string, applicationID string) (res []*auth.UsersGroupApplicationsList, err error)
	FindByGroupIDAndApplicationID(enableTracing bool, ctx context.Context, groupID, applicationID string) (res []*auth.UsersGroupApplicationsList, err error)
	FindByGroupIDAndMultipleApplicationID(enableTracing bool, ctx context.Context, groupID string, applicationID []string) (res []*auth.UsersGroupApplicationsList, err error)
	FindByMultipleApplicationID(enableTracing bool, ctx context.Context, applicationID []string) (res []*auth.UsersGroupApplicationsList, err error)
	AddApplication(enableTracing bool, ctx context.Context, req *auth.UsersGroupApplicationsList) (err error)
	DelApplication(enableTracing bool, ctx context.Context, req *auth.UsersGroupApplicationsList) (err error)
	GetData(enableTracing bool, ctx context.Context, limit, skip int) (res []*auth.UsersGroupApplicationsList, err error)
	BulkInsert(enableTracing bool, ctx context.Context, req []*auth.UsersGroupApplicationsList) (err error)
}

type UsersGroupScopes added in v0.0.3

type UsersGroupScopes interface {
	FindByGroupID(enableTracing bool, ctx context.Context, groupID string) (res []*auth.UsersGroupScopesList, err error)
	FindByMultipleGroupID(enableTracing bool, ctx context.Context, groupID []string) (res []*auth.UsersGroupScopesList, err error)
	FindByGroupIDAndScopeID(enableTracing bool, ctx context.Context, groupID, scopeID string) (res []*auth.UsersGroupScopesList, err error)
	FindByMultipleGroupIDAndScopeID(enableTracing bool, ctx context.Context, groupID, scopeID []string) (res []*auth.UsersGroupScopesList, err error)
	FindByGroupIDAndMultiScopeID(enableTracing bool, ctx context.Context, groupID string, scopeID []string) (res []*auth.UsersGroupScopesList, err error)
	FindByScopeID(enableTracing bool, ctx context.Context, scopeID []string) (res []*auth.UsersGroupScopesList, err error)
	AddScope(enableTracing bool, ctx context.Context, req *auth.UsersGroupScopesList) (err error)
	DelScope(enableTracing bool, ctx context.Context, req *auth.UsersGroupScopesList) (err error)
	CountWithParams(enableTracing bool, ctx context.Context, req *auth.GetUsersGroupScopesRequest) (count int64, err error)
	FindWithParams(enableTracing bool, ctx context.Context, req *auth.GetUsersGroupScopesRequest) (res []*auth.UsersGroupScopesList, err error)
	GetData(enableTracing bool, ctx context.Context, limit, skip int) (res []*auth.UsersGroupScopesList, err error)
	BulkInsert(enableTracing bool, ctx context.Context, req []*auth.UsersGroupScopesList) (err error)
}

type UsersGroups added in v0.0.3

type UsersGroups interface {
	CountWithParams(enableTracing bool, ctx context.Context, req *auth.GetUsersGroupRequest) (count int64, err error)
	FindWithParams(enableTracing bool, ctx context.Context, req *auth.GetUsersGroupRequest) (res []*auth.UsersGroupList, err error)
	FindByID(enableTracing bool, ctx context.Context, id string) (res []*auth.UsersGroupList, err error)
	FindByDefault(enableTracing bool, ctx context.Context, isDefault bool) (res []*auth.UsersGroupList, err error)
	FindBySystem(enableTracing bool, ctx context.Context, system bool) (res []*auth.UsersGroupList, err error)
	FindByDefaultAndSystem(enableTracing bool, ctx context.Context, isDefault, system bool) (res []*auth.UsersGroupList, err error)
	FindByIDAndDefaultAndSystem(enableTracing bool, ctx context.Context, id string, isDefault, system bool) (res []*auth.UsersGroupList, err error)
	FindByIDAndSystem(enableTracing bool, ctx context.Context, id string, system bool) (res []*auth.UsersGroupList, err error)
	FindByMultipleIDAndSystem(enableTracing bool, ctx context.Context, id []string, system bool) (res []*auth.UsersGroupList, err error)
	Create(enableTracing bool, ctx context.Context, data *auth.UsersGroupList) (err error)
	DeleteByIDAndSystem(enableTracing bool, ctx context.Context, id string, system bool) (err error)
	GetData(enableTracing bool, ctx context.Context, limit, skip int) (res []*auth.UsersGroupList, err error)
	BulkInsert(enableTracing bool, ctx context.Context, req []*auth.UsersGroupList) (err error)
}

Jump to

Keyboard shortcuts

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