authcrunch

package module
v1.0.47 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

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

Please browse to authp.github.io.

Issues

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

Plugins

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"`
	SingleSignOnProviders []*sso.SingleSignOnProviderConfig `json:"sso_providers,omitempty" xml:"sso_providers,omitempty" yaml:"sso_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

func (cfg *Config) AddDisabledIdentityProvider(s string)

AddDisabledIdentityProvider adds the names of disabled identity providers.

func (*Config) AddDisabledIdentityStore

func (cfg *Config) AddDisabledIdentityStore(s string)

AddDisabledIdentityStore adds the names of disabled identity stores.

func (*Config) AddIdentityProvider

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

AddIdentityProvider adds an identity provider configuration.

func (*Config) AddIdentityStore

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

AddIdentityStore adds an identity store configuration.

func (*Config) AddMessagingProvider

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

AddMessagingProvider adds a messaging provider configuration.

func (*Config) AddSingleSignOnProvider

func (cfg *Config) AddSingleSignOnProvider(data map[string]interface{}) error

AddSingleSignOnProvider adds a single sign-on provider configuration.

func (*Config) AddUserRegistry

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

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

GetConfig returns Server configuration.

func (*Server) GetGatekeeperByName

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

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

func (*Server) GetPortalByName

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