Documentation ¶
Index ¶
- func Factory(ctx context.Context, conf *logical.BackendConfig) (logical.Backend, error)
- func NewPathConfig(b *OpenStackAuthBackend) []*framework.Path
- func NewPathLogin(b *OpenStackAuthBackend) []*framework.Path
- func NewPathRole(b *OpenStackAuthBackend) []*framework.Path
- type Attestor
- func (at *Attestor) Attest(instance *servers.Server, role *Role, addr string) error
- func (at *Attestor) AttestAddr(instance *servers.Server, addr string) error
- func (at *Attestor) AttestMetadata(instance *servers.Server, metadataKey string, roleName string) error
- func (at *Attestor) AttestStatus(instance *servers.Server) error
- func (at *Attestor) AttestTenantID(instance *servers.Server, tenantID string) error
- func (at *Attestor) AttestUserID(instance *servers.Server, userID string) error
- func (at *Attestor) VerifyAuthLimit(instance *servers.Server, limit int, deadline time.Time) (int, error)
- func (at *Attestor) VerifyAuthPeriod(instance *servers.Server, period time.Duration) (time.Time, error)
- type AuthAttempt
- type Config
- type OpenStackAuthBackend
- type Role
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPathConfig ¶
func NewPathConfig(b *OpenStackAuthBackend) []*framework.Path
func NewPathLogin ¶
func NewPathLogin(b *OpenStackAuthBackend) []*framework.Path
func NewPathRole ¶
func NewPathRole(b *OpenStackAuthBackend) []*framework.Path
Types ¶
type Attestor ¶
type Attestor struct {
// contains filtered or unexported fields
}
func (*Attestor) Attest ¶
Attest is used to attest a OpenStack instance based on binded role and IP address.
func (*Attestor) AttestAddr ¶
AttestAddr is used to attest the IP address of OpenStack instance with source IP address. This method support IPv4 only.
func (*Attestor) AttestMetadata ¶
func (at *Attestor) AttestMetadata(instance *servers.Server, metadataKey string, roleName string) error
AttestMetadata is used to attest a OpenStack instance metadata.
func (*Attestor) AttestStatus ¶
AttestStatus is used to attest the status of OpenStack instance.
func (*Attestor) AttestTenantID ¶
AttestTenantID is used to attest the tenant ID of OpenStack instance.
func (*Attestor) AttestUserID ¶ added in v0.3.0
AttestUserID is used to attest the user ID of OpenStack instance.
func (*Attestor) VerifyAuthLimit ¶
func (at *Attestor) VerifyAuthLimit(instance *servers.Server, limit int, deadline time.Time) (int, error)
VerifyAuthLimit is used to verify the number of attempts of authentication. The limit of authentication is specified by a binded role.
func (*Attestor) VerifyAuthPeriod ¶
func (at *Attestor) VerifyAuthPeriod(instance *servers.Server, period time.Duration) (time.Time, error)
VerifyAuthPeriod is used to verify the deadline of authentication. The deadline is calculated by the create date of OpenStack instance and the authentication period specified by a binded role.
type AuthAttempt ¶
type Config ¶
type Config struct { AuthURL string `json:"auth_url" structs:"auth_url" mapstructure:"auth_url"` Token string `json:"token" structs:"token" mapstructure:"token"` UserID string `json:"user_id" structs:"user_id" mapstructure:"user_id"` Username string `json:"username" structs:"username" mapstructure:"username"` Password string `json:"password" structs:"password" mapstructure:"password"` ProjectID string `json:"project_id" structs:"project_id" mapstructure:"project_id"` ProjectName string `json:"project_name" structs:"project_name" mapstructure:"project_name"` TenantID string `json:"tenant_id" structs:"tenant_id" mapstructure:"tenant_id"` TenantName string `json:"tenant_name" structs:"tenant_name" mapstructure:"tenant_name"` UserDomainID string `json:"user_domain_id" structs:"user_domain_id" mapstructure:"user_domain_id"` UserDomainName string `json:"user_domain_name" structs:"user_domain_name" mapstructure:"user_domain_name"` ProjectDomainID string `json:"project_domain_id" structs:"project_domain_id" mapstructure:"project_domain_id"` ProjectDomainName string `json:"project_domain_name" structs:"project_domain_name" mapstructure:"project_domain_name"` DomainID string `json:"domain_id" structs:"domain_id" mapstructure:"domain_id"` DomainName string `json:"domain_name" structs:"domain_name" mapstructure:"domain_name"` }
type OpenStackAuthBackend ¶
func NewBackend ¶
func NewBackend() *OpenStackAuthBackend
func (*OpenStackAuthBackend) Close ¶
func (b *OpenStackAuthBackend) Close()
type Role ¶
type Role struct { Name string `json:"name" structs:"name" mapstructure:"name"` Policies []string `json:"policies" structs:"policies" mapstructure:"policies"` TTL time.Duration `json:"ttl" structs:"ttl" mapstructure:"ttl"` MaxTTL time.Duration `json:"max_ttl" structs:"max_ttl" mapstructure:"max_ttl"` Period time.Duration `json:"period" structs:"period" mapstructure:"period"` MetadataKey string `json:"metadata_key" structs:"metadata_key" mapstructure:"metadata_key"` TenantID string `json:"tenant_id" structs:"tenant_id" mapstructure:"tenant_id"` UserID string `json:"user_id" structs:"user_id" mapstructure:"user_id"` AuthPeriod time.Duration `json:"auth_period" structs:"auth_period" mapstructure:"auth_period"` AuthLimit int `json:"auth_limit" structs:"auth_limit" mapstructure:"auth_limit"` }