Documentation ¶
Index ¶
- func AddBlockingCondition(value string)
- func AddBlockingIPCondition(value *throttle.IPCondition)
- func AddKeyTemplate(value string)
- func ClearKeyManagerData()
- func FetchAPIsFromControlPlane(updatedAPIID string, updatedEnvs []string)
- func FetchKeyManagersOnStartUp(conf *config.Config)
- func FetchThrottleData(endpoint string, c chan sync.SyncAPIResponse)
- func GetBlockingConditions() []string
- func GetBlockingIPConditions() []*throttle.IPCondition
- func GetKeyTemplates() []string
- func PushAPIProjects(payload []byte, environments []string) error
- func RemoveBlockingCondition(key string)
- func RemoveBlockingIPCondition(ip *throttle.IPCondition)
- func RemoveKeyTemplate(key string)
- func RetrieveTokens(c chan sync.SyncAPIResponse)
- func UpdateBlockingConditions()
- func UpdateKeyTemplates()
- func UpdateRevokedTokens()
- type BlockConditions
- type IPCondition
- type RevokedToken
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 ¶
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 ¶
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 PushAPIProjects ¶
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.