authcrunch

package module
v1.0.27 Latest Latest
Warning

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

Go to latest
Published: May 7, 2022 License: Apache-2.0 Imports: 12 Imported by: 5

README

go-authcrunch

AuthCrunch provides Authentication, Authorization, and Accounting (AAA) Security Functions (SF) in Golang.

This code base contains the functions implementing AAA. It is a standalone library, i.e. it can be used with Gin, Beego, Echo, Mux (Gorilla). Originally, the library was a part of the development of Caddy v2 caddy-auth-portal, caddy-auth-jwt, and caddy-authorize plugins.

Documentation: authp.github.io

Issues:

  • Caddy-specific: Open
  • Other Go-frameworks: Open

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Credentials           *credentials.Config           `json:"credentials,omitempty" xml:"credentials,omitempty" yaml:"credentials,omitempty"`
	Messaging             *messaging.Config             `json:"messaging,omitempty" xml:"messaging,omitempty" yaml:"messaging,omitempty"`
	AuthenticationPortals []*authn.PortalConfig         `json:"authentication_portals,omitempty" xml:"authentication_portals,omitempty" yaml:"authentication_portals,omitempty"`
	AuthorizationPolicies []*authz.PolicyConfig         `json:"authorization_policies,omitempty" xml:"authorization_policies,omitempty" yaml:"authorization_policies,omitempty"`
	IdentityStores        []*ids.IdentityStoreConfig    `json:"identity_stores,omitempty" xml:"identity_stores,omitempty" yaml:"identity_stores,omitempty"`
	IdentityProviders     []*idp.IdentityProviderConfig `json:"identity_providers,omitempty" xml:"identity_providers,omitempty" yaml:"identity_providers,omitempty"`

	UserRegistries []*registry.UserRegistryConfig `json:"user_registries,omitempty" xml:"user_registries,omitempty" yaml:"user_registries,omitempty"`
	// contains filtered or unexported fields
}

Config is a configuration of Server.

func NewConfig

func NewConfig() *Config

NewConfig returns an instance of Config.

func (*Config) AddAuthenticationPortal

func (cfg *Config) AddAuthenticationPortal(p *authn.PortalConfig) error

AddAuthenticationPortal adds an authentication portal configuration.

func (*Config) AddAuthorizationPolicy

func (cfg *Config) AddAuthorizationPolicy(p *authz.PolicyConfig) error

AddAuthorizationPolicy adds an authorization policy configuration.

func (*Config) AddCredential

func (cfg *Config) AddCredential(c credentials.Credential) error

AddCredential adds a credential configuration.

func (*Config) AddDisabledIdentityProvider added in v1.0.21

func (cfg *Config) AddDisabledIdentityProvider(s string)

AddDisabledIdentityProvider adds the names of disabled identity providers.

func (*Config) AddDisabledIdentityStore added in v1.0.21

func (cfg *Config) AddDisabledIdentityStore(s string)

AddDisabledIdentityStore adds the names of disabled identity stores.

func (*Config) AddIdentityProvider added in v1.0.20

func (cfg *Config) AddIdentityProvider(name, kind string, data map[string]interface{}) error

AddIdentityProvider adds an identity provider configuration.

func (*Config) AddIdentityStore added in v1.0.20

func (cfg *Config) AddIdentityStore(name, kind string, data map[string]interface{}) error

AddIdentityStore adds an identity store configuration.

func (*Config) AddMessagingProvider added in v1.0.10

func (cfg *Config) AddMessagingProvider(p messaging.Provider) error

AddMessagingProvider adds a messaging provider configuration.

func (*Config) AddUserRegistry added in v1.0.23

func (cfg *Config) AddUserRegistry(r *registry.UserRegistryConfig) error

AddUserRegistry adds a user registry configuration.

func (*Config) Validate

func (cfg *Config) Validate() error

Validate validates Config.

type Server

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

Server represents AAA SF server.

func NewServer

func NewServer(config *Config, logger *zap.Logger) (*Server, error)

NewServer returns an instance of Server.

func (*Server) GetConfig added in v1.0.20

func (srv *Server) GetConfig() map[string]interface{}

GetConfig returns Server configuration.

func (*Server) GetGatekeeperByName added in v1.0.20

func (srv *Server) GetGatekeeperByName(s string) (*authz.Gatekeeper, error)

GetGatekeeperByName returns an instance of authz.Gatekeeper based on its name.

func (*Server) GetPortalByName added in v1.0.20

func (srv *Server) GetPortalByName(s string) (*authn.Portal, error)

GetPortalByName returns an instance of authn.Portal based on its name.

Jump to

Keyboard shortcuts

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