localcopy

package
v0.0.0-...-365054f Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

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

func (pr *Oracle) PeriodicFetchingEnabled() bool

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) Start

func (pr *Oracle) Start()

Start begins fetching policies to subscribers

func (*Oracle) Stop

func (pr *Oracle) Stop()

Stop ends fetching policies to subscribers

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

Jump to

Keyboard shortcuts

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