synchronizer

package
v0.0.0-...-0c1943d Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddBlockingCondition

func AddBlockingCondition(value string)

AddBlockingCondition adds a blocking condition to the blocking condition map

func AddBlockingIPCondition

func AddBlockingIPCondition(value *throttle.IPCondition)

AddBlockingIPCondition adds a blocking IP condition to the blocking IP condition map

func AddKeyTemplate

func AddKeyTemplate(value string)

AddKeyTemplate adds a key template to the key template map

func ClearKeyManagerData

func ClearKeyManagerData()

ClearKeyManagerData clears all the key manager data before reloading

func FetchAPIsFromControlPlane

func FetchAPIsFromControlPlane(updatedAPIID string, updatedEnvs []string)

FetchAPIsFromControlPlane method pulls API data for a given APIs according to a given API ID and a list of environments that API has been deployed to. updatedAPIID is the corresponding ID of the API in the form of an UUID updatedEnvs contains the list of environments the API deployed to.

func FetchKeyManagersOnStartUp

func FetchKeyManagersOnStartUp(conf *config.Config)

FetchKeyManagersOnStartUp pulls the Key managers calling to the API manager API Manager returns a .zip file as a response and this function returns a byte slice of that ZIP file.

func FetchThrottleData

func FetchThrottleData(endpoint string, c chan sync.SyncAPIResponse)

FetchThrottleData pulls the startup Throttle Data required for custom and blocking condition based throttling. This request goes to traffic manager node.

func GetBlockingConditions

func GetBlockingConditions() []string

GetBlockingConditions returns blocking conditions

func GetBlockingIPConditions

func GetBlockingIPConditions() []*throttle.IPCondition

GetBlockingIPConditions returns blocking IP conditions

func GetKeyTemplates

func GetKeyTemplates() []string

GetKeyTemplates returns key templates

func PushAPIProjects

func PushAPIProjects(payload []byte, environments []string) error

PushAPIProjects configure the router and enforcer using the zip containing API project(s) as byte slice. This method ensures to update the enforcer and router using entries inside the downloaded apis.zip one by one. If the updating envoy or enforcer fails, this method returns an error, if not error would be nil.

func RemoveBlockingCondition

func RemoveBlockingCondition(key string)

RemoveBlockingCondition removes entry from blocking condition map

func RemoveBlockingIPCondition

func RemoveBlockingIPCondition(ip *throttle.IPCondition)

RemoveBlockingIPCondition removes entry from blocking IP condition map

func RemoveKeyTemplate

func RemoveKeyTemplate(key string)

RemoveKeyTemplate removes key template from the key template map

func RetrieveTokens

func RetrieveTokens(c chan sync.SyncAPIResponse)

RetrieveTokens func return tokens

func UpdateBlockingConditions

func UpdateBlockingConditions()

UpdateBlockingConditions pulls blocking conditions from the traffic manager and updates the enforcer's xds cache

func UpdateKeyTemplates

func UpdateKeyTemplates()

UpdateKeyTemplates pulls keytemplates from the traffic manager and updates the enforcer's xds cache

func UpdateRevokedTokens

func UpdateRevokedTokens()

UpdateRevokedTokens pulls revoked tokens from control plane. Once it's done, revoked tokens will be pushed to the enforcers.

Types

type BlockConditions

type BlockConditions struct {
	API          []string      `json:"api"`
	Application  []string      `json:"application"`
	User         []string      `json:"user"`
	Subscription []string      `json:"subscription"`
	Custom       []string      `json:"custom"`
	IP           []IPCondition `json:"ip"`
}

BlockConditions defines a blocking condition retrieved from traffic manager

type IPCondition

type IPCondition struct {
	Type         string
	ID           int32
	FixedIP      string
	StartingIP   string
	EndingIP     string
	Invert       bool
	TenantDomain string
	State        string
}

IPCondition defines a IP condition

type RevokedToken

type RevokedToken struct {
	JWT        string `json:"jwt_signature"`
	ExpiryTime int64  `json:"expiry_time"`
}

RevokedToken contains the JWT and the expirty time of the revoked JWT token.

Jump to

Keyboard shortcuts

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