Documentation ¶
Index ¶
- type Oracle
- func (pr *Oracle) PeriodicFetchingEnabled() bool
- func (pr *Oracle) Policies(policyIDs []string) []market.AccessPolicy
- func (pr *Oracle) Policy(policyID string) market.AccessPolicy
- func (pr *Oracle) Start()
- func (pr *Oracle) Stop()
- func (pr *Oracle) SubscribePolicies(policies []market.AccessPolicy, repository *Repository) error
- type Repository
- func (r *Repository) HasDNSRules() bool
- func (r *Repository) IsHostAllowed(host string) bool
- func (r *Repository) IsIdentityAllowed(identity identity.Identity) bool
- func (r *Repository) Policies() []market.AccessPolicy
- func (r *Repository) Rules() []market.AccessPolicyRuleSet
- func (r *Repository) RulesForPolicies(policies []market.AccessPolicy) ([]market.AccessPolicyRuleSet, error)
- func (r *Repository) RulesForPolicy(policy market.AccessPolicy) (market.AccessPolicyRuleSet, error)
- func (r *Repository) SetPolicyRules(policy market.AccessPolicy, policyRules market.AccessPolicyRuleSet)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Oracle ¶
type Oracle struct {
// contains filtered or unexported fields
}
Oracle represents async policy fetcher from TrustOracle
func NewOracle ¶
func NewOracle(client *requests.HTTPClient, policyURL string, interval time.Duration, fetchingEnabled bool) *Oracle
NewOracle create instance of policy fetcher
func (*Oracle) PeriodicFetchingEnabled ¶
PeriodicFetchingEnabled returns if periodic fetching is enabled
func (*Oracle) Policies ¶
func (pr *Oracle) Policies(policyIDs []string) []market.AccessPolicy
Policies converts given values to list of valid policies
func (*Oracle) Policy ¶
func (pr *Oracle) Policy(policyID string) market.AccessPolicy
Policy converts given value to valid policy rule
func (*Oracle) SubscribePolicies ¶
func (pr *Oracle) SubscribePolicies(policies []market.AccessPolicy, repository *Repository) error
SubscribePolicies adds given policies to repository and syncs changes of it's items from TrustOracle
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository represents async policy fetcher from TrustOracle
func NewRepository ¶
func NewRepository() *Repository
NewRepository create instance of policy repository
func (*Repository) HasDNSRules ¶
func (r *Repository) HasDNSRules() bool
HasDNSRules returns flag if any DNS rules are applied
func (*Repository) IsHostAllowed ¶
func (r *Repository) IsHostAllowed(host string) bool
IsHostAllowed returns flag if given FQDN host should be allowed by rules
func (*Repository) IsIdentityAllowed ¶
func (r *Repository) IsIdentityAllowed(identity identity.Identity) bool
IsIdentityAllowed returns flag if given identity should be allowed by rules
func (*Repository) Policies ¶
func (r *Repository) Policies() []market.AccessPolicy
Policies list policies in repository
func (*Repository) Rules ¶
func (r *Repository) Rules() []market.AccessPolicyRuleSet
Rules gives list of items all policies
func (*Repository) RulesForPolicies ¶
func (r *Repository) RulesForPolicies(policies []market.AccessPolicy) ([]market.AccessPolicyRuleSet, error)
RulesForPolicies gives list of items of given policies
func (*Repository) RulesForPolicy ¶
func (r *Repository) RulesForPolicy(policy market.AccessPolicy) (market.AccessPolicyRuleSet, error)
RulesForPolicy gives items of given polic
func (*Repository) SetPolicyRules ¶
func (r *Repository) SetPolicyRules(policy market.AccessPolicy, policyRules market.AccessPolicyRuleSet)
SetPolicyRules set policy and it's items to repository