Documentation
      ¶
    
    
  
    
  
    Overview ¶
Package middlewares provides a set of middleware functions used to check Zitadel access token for auth and roles.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ZitadelAuth ¶
type ZitadelAuth struct {
	Domain string // Zitadel instance domain
	Key    string // path to key.json
	AuthZ  *authorization.Authorizer[*oauth.IntrospectionContext]
	Config config.Config
}
    ZitadelAuth holds the configuration for Zitadel and the Authorizer
func NewZitadelAuth ¶
func NewZitadelAuth(conf config.Config) ZitadelAuth
NewZitadelAuth creates a new ZitadelAuth object with the given configuration. It sets up the Zitadel SDK with the given domain and key path.
func (*ZitadelAuth) AllowAnyOfRoles ¶
AllowAnyOfRoles middleware checks if the given request has a valid access token and if the user has any of the given roles.
func (*ZitadelAuth) AllowAuthenticated ¶
func (za *ZitadelAuth) AllowAuthenticated(next http.Handler) http.Handler
AllowAuthenticated middleware checks if the given request has a valid acess token.
 Click to show internal directories. 
   Click to hide internal directories.