Documentation ¶
Index ¶
Constants ¶
View Source
const ( // CodeTypeMissingAccountId indicates that the accountId was not present on the context CodeTypeMissingAccountId errors.CodeType = "MISSING_ACCOUNT_ID" // CodeTypeMissingBrandId indicates that the brandId was not present on the context CodeTypeMissingBrandId errors.CodeType = "MISSING_BRAND_ID" // CodeTypeErrorExecutingAuthorizationQuery indicates that it was not possible to execute authorization client query CodeTypeErrorExecutingAuthorizationQuery errors.CodeType = "CANT_EXECUTE_AUTH_QUERY" // CodeTypeAccessDenied indicates that authorizatior client denied account access CodeTypeAccessDenied errors.CodeType = "ACCESS_DENIED" )
View Source
const ContextKeyAllowedStores string = "allowed_stores"
ContextKeyAllowedStores is the context key that get and sets all accounts allowed stores
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountAuthorizator ¶
AccountAuthorizator is the struct responsible for create account authorizarion
func MustNewAccountAuthorizator ¶
func MustNewAccountAuthorizator( logger infra.Logger, authClient infra.AuthorizatorClient, authorizatorTimeout time.Duration, resourceName string, resourseFilters []ResourseFilter, ) AccountAuthorizator
MustNewAccountAuthorizator constructs a new account authorization middleware. It panics if any error is found.
func NewAccountAuthorizator ¶
func NewAccountAuthorizator( logger infra.Logger, authClient infra.AuthorizatorClient, authorizatorTimeout time.Duration, resourceName string, resourseFilters []ResourseFilter, ) (AccountAuthorizator, error)
NewAccountAuthorizator constructs a new account authorization middleware
type ResourseFilter ¶
type ResourseFilter int
ResourseFilter defines a type that represents a resource filter as an integer
const ( // StoreFilter means a numeric representation of the stores filter StoreFilter ResourseFilter = iota )
func (ResourseFilter) String ¶
func (s ResourseFilter) String() string
String returns the equivalent string of the Resource filters integers
Click to show internal directories.
Click to hide internal directories.