Documentation ¶
Index ¶
- Constants
- type AssertionAttribute
- type AssertionAttributeDeliver
- type AuthenticatingIdp
- type AuthenticationAndAccess
- type Builder
- type Bundle
- type BundleBuilder
- type Client
- func (c Client) AuthenticationURL(id ProviderID) string
- func (c *Client) CreateServiceProvider(serviceName, companyID string) (err error)
- func (c *Client) DeleteServiceProvider(spID string) (err error)
- func (c *Client) GenerateServiceProviderSecret(secretCfg SecretConfiguration) (_ *ServiceProviderSecret, err error)
- func (c *Client) GetCompany() (_ *Company, err error)
- func (c *Client) SetAssertionAttribute(spID string, payload PostAssertionAttributes) error
- func (c *Client) SetAuthenticationAndAccess(spID string, payload AuthenticationAndAccess) error
- func (c *Client) SetSubjectNameIdentifier(spID string, payload SubjectNameIdentifier) error
- func (c *Client) SetType(spID string, payload Type) error
- type ClientConfig
- type Company
- type Config
- type DefaultAttribute
- type FakeClient
- func (f FakeClient) AuthenticationURL(id ProviderID) string
- func (f *FakeClient) CreateServiceProvider(name string, _ string) error
- func (f *FakeClient) DeleteServiceProvider(id string) error
- func (f FakeClient) GenerateServiceProviderSecret(ss SecretConfiguration) (*ServiceProviderSecret, error)
- func (f *FakeClient) GetCompany() (*Company, error)
- func (f *FakeClient) GetServiceProvider(id string) (*ServiceProvider, error)
- func (f FakeClient) SetAssertionAttribute(id string, paa PostAssertionAttributes) error
- func (f FakeClient) SetAuthenticationAndAccess(id string, auth AuthenticationAndAccess) error
- func (f FakeClient) SetSubjectNameIdentifier(id string, sni SubjectNameIdentifier) error
- func (f *FakeClient) SetType(id string, iasType Type) error
- type IASCLient
- type IdentityProvider
- type OpenIDConnectConfig
- type PostAssertionAttributes
- type ProviderID
- type RBAConfig
- type RBARules
- type Request
- type RestAPIClientSecret
- type SPSecret
- type SecretConfiguration
- type ServiceProvider
- type ServiceProviderAccess
- type ServiceProviderBundle
- func (b *ServiceProviderBundle) ConfigureServiceProvider() error
- func (b *ServiceProviderBundle) ConfigureServiceProviderType(consolePath string) error
- func (b *ServiceProviderBundle) CreateServiceProvider() error
- func (b *ServiceProviderBundle) DeleteServiceProvider() error
- func (b *ServiceProviderBundle) FetchServiceProviderData() error
- func (b *ServiceProviderBundle) GenerateSecret() (*ServiceProviderSecret, error)
- func (b *ServiceProviderBundle) ServiceProviderExist() bool
- func (b *ServiceProviderBundle) ServiceProviderName() string
- type ServiceProviderSecret
- type SubjectNameIdentifier
- type Type
Constants ¶
const ( PathServiceProviders = "/service/sps" PathCompanyGlobal = "/service/company/global" PathAccess = "/service/sps/%s/rba" PathIdentityProviders = "/service/idp" PathDelete = "/service/sps/delete" )
const ( FakeIdentityProviderName = "IdentityProviderName" FakeIdentityProviderID = "0dbae593-ab1d-4774-97c1-5118ea22ea2d" FakeProviderName = "ProviderName" FakeProviderID = "eebb54dd-e4d5-43a1-929a-e98ea2831342" FakeClientID = "cid" FakeClientSecret = "csc" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssertionAttribute ¶
type AssertionAttributeDeliver ¶
type AssertionAttributeDeliver struct {
// contains filtered or unexported fields
}
AssertionAttributeDeliver ensures required AssertionAttributes instead remove all and replace by new one, it will remove only not existing in templates and leave existing with probably fresher version of user attributes
func NewAssertionAttributeDeliver ¶
func NewAssertionAttributeDeliver() *AssertionAttributeDeliver
NewAssertionAttributeDeliver returns new AssertionAttributeDeliver with default attributes template
func (*AssertionAttributeDeliver) GenerateAssertionAttribute ¶
func (a *AssertionAttributeDeliver) GenerateAssertionAttribute(serviceProvider ServiceProvider) []AssertionAttribute
GenerateAssertionAttribute remove not existing in template attributes, leaves existing
type AuthenticatingIdp ¶
type AuthenticationAndAccess ¶
type AuthenticationAndAccess struct {
ServiceProviderAccess ServiceProviderAccess `json:"service_provider"`
}
type Bundle ¶
type Bundle interface { FetchServiceProviderData() error ServiceProviderName() string ServiceProviderExist() bool CreateServiceProvider() error DeleteServiceProvider() error ConfigureServiceProvider() error ConfigureServiceProviderType(path string) error GenerateSecret() (*ServiceProviderSecret, error) }
type BundleBuilder ¶
func NewBundleBuilder ¶
func NewBundleBuilder(httpClient *http.Client, config Config) BundleBuilder
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (Client) AuthenticationURL ¶
func (c Client) AuthenticationURL(id ProviderID) string
func (*Client) CreateServiceProvider ¶
func (*Client) DeleteServiceProvider ¶
func (*Client) GenerateServiceProviderSecret ¶
func (c *Client) GenerateServiceProviderSecret(secretCfg SecretConfiguration) (_ *ServiceProviderSecret, err error)
func (*Client) GetCompany ¶
func (*Client) SetAssertionAttribute ¶
func (c *Client) SetAssertionAttribute(spID string, payload PostAssertionAttributes) error
func (*Client) SetAuthenticationAndAccess ¶
func (c *Client) SetAuthenticationAndAccess(spID string, payload AuthenticationAndAccess) error
func (*Client) SetSubjectNameIdentifier ¶
func (c *Client) SetSubjectNameIdentifier(spID string, payload SubjectNameIdentifier) error
type ClientConfig ¶
type Company ¶
type Company struct { ServiceProviders []ServiceProvider `json:"service_providers"` IdentityProviders []IdentityProvider `json:"identity_providers"` }
type DefaultAttribute ¶
type FakeClient ¶
type FakeClient struct {
// contains filtered or unexported fields
}
func NewFakeClient ¶
func NewFakeClient() *FakeClient
func (FakeClient) AuthenticationURL ¶
func (f FakeClient) AuthenticationURL(id ProviderID) string
func (*FakeClient) CreateServiceProvider ¶
func (f *FakeClient) CreateServiceProvider(name string, _ string) error
func (*FakeClient) DeleteServiceProvider ¶
func (f *FakeClient) DeleteServiceProvider(id string) error
func (FakeClient) GenerateServiceProviderSecret ¶
func (f FakeClient) GenerateServiceProviderSecret(ss SecretConfiguration) (*ServiceProviderSecret, error)
func (*FakeClient) GetCompany ¶
func (f *FakeClient) GetCompany() (*Company, error)
func (*FakeClient) GetServiceProvider ¶
func (f *FakeClient) GetServiceProvider(id string) (*ServiceProvider, error)
func (FakeClient) SetAssertionAttribute ¶
func (f FakeClient) SetAssertionAttribute(id string, paa PostAssertionAttributes) error
func (FakeClient) SetAuthenticationAndAccess ¶
func (f FakeClient) SetAuthenticationAndAccess(id string, auth AuthenticationAndAccess) error
func (FakeClient) SetSubjectNameIdentifier ¶
func (f FakeClient) SetSubjectNameIdentifier(id string, sni SubjectNameIdentifier) error
type IASCLient ¶
type IASCLient interface { GetCompany() (*Company, error) CreateServiceProvider(string, string) error DeleteServiceProvider(string) error GenerateServiceProviderSecret(SecretConfiguration) (*ServiceProviderSecret, error) AuthenticationURL(ProviderID) string SetType(string, Type) error SetAssertionAttribute(string, PostAssertionAttributes) error SetSubjectNameIdentifier(string, SubjectNameIdentifier) error SetAuthenticationAndAccess(string, AuthenticationAndAccess) error }
type IdentityProvider ¶
type OpenIDConnectConfig ¶
type PostAssertionAttributes ¶
type PostAssertionAttributes struct {
AssertionAttributes []AssertionAttribute `json:"assertion_attributes"`
}
type ProviderID ¶
type ProviderID string
type RestAPIClientSecret ¶
type SecretConfiguration ¶
type SecretConfiguration struct { Organization string `json:"organization"` ID string `json:"id"` DefaultAuthIDp string `json:"default_auth_idp"` RestAPIClientSecret RestAPIClientSecret `json:"rest_api_client_secret"` }
type ServiceProvider ¶
type ServiceProvider struct { DisplayName string `json:"display_name"` ID string `json:"id"` AssertionAttributes []AssertionAttribute `json:"assertion_attributes"` DefaultAttributes []DefaultAttribute `json:"default_attributes"` Organization string `json:"organization"` SsoType string `json:"ssoType"` RedirectURIs []string `json:"redirect_uris"` NameIDAttribute string `json:"name_id_attribute"` RBAConfig RBAConfig `json:"rba_config"` AuthenticatingIdp AuthenticatingIdp `json:"authenticatingIdp"` Secret []SPSecret `json:"clientSecrets"` }
type ServiceProviderAccess ¶
type ServiceProviderAccess struct {
RBAConfig RBAConfig `json:"rba_config"`
}
type ServiceProviderBundle ¶
type ServiceProviderBundle struct {
// contains filtered or unexported fields
}
func NewServiceProviderBundle ¶
func NewServiceProviderBundle(bundleIdentifier string, c IASCLient, cfg Config) *ServiceProviderBundle
NewServiceProviderBundle returns pointer to new ServiceProviderBundle
func (*ServiceProviderBundle) ConfigureServiceProvider ¶
func (b *ServiceProviderBundle) ConfigureServiceProvider() error
ConfigureServiceProvider sets configuration such as assertion attributes, name identifier and gropus allows to connect with specific ServiceProvider
func (*ServiceProviderBundle) ConfigureServiceProviderType ¶
func (b *ServiceProviderBundle) ConfigureServiceProviderType(consolePath string) error
ConfigureServiceProviderType sets SSO type, name and URLs based on provided URL for ServiceProvider
func (*ServiceProviderBundle) CreateServiceProvider ¶
func (b *ServiceProviderBundle) CreateServiceProvider() error
CreateServiceProvider creates new ServiceProvider on IAS based on name it will be create in specific company/organization
func (*ServiceProviderBundle) DeleteServiceProvider ¶
func (b *ServiceProviderBundle) DeleteServiceProvider() error
DeleteServiceProvider removes ServiceProvider from IAS
func (*ServiceProviderBundle) FetchServiceProviderData ¶
func (b *ServiceProviderBundle) FetchServiceProviderData() error
FetchServiceProviderData fetches all ServiceProviders and IdentityProviders for company saves specific elements based on the name
func (*ServiceProviderBundle) GenerateSecret ¶
func (b *ServiceProviderBundle) GenerateSecret() (*ServiceProviderSecret, error)
GenerateSecret generates new ID and Secret for ServiceProvider
func (*ServiceProviderBundle) ServiceProviderExist ¶
func (b *ServiceProviderBundle) ServiceProviderExist() bool
ServiceProviderExist deteminates whether a particular item has been found
func (*ServiceProviderBundle) ServiceProviderName ¶
func (b *ServiceProviderBundle) ServiceProviderName() string
ServiceProviderName returns SP name which includes instance ID
type ServiceProviderSecret ¶
type SubjectNameIdentifier ¶
type SubjectNameIdentifier struct {
NameIDAttribute string `json:"name_id_attribute"`
}
type Type ¶
type Type struct { SsoType string `json:"ssoType"` ServiceProviderName string `json:"sp_name"` OpenIDConnectConfig OpenIDConnectConfig `json:"openId_connect_configuration"` }