messaging

package
v0.0.0-...-a4b769c Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package messaging holds the implementation for event listeners functions

Package messaging holds the implementation for event listeners functions

Package messaging holds the implementation for event listeners functions

Index

Constants

This section is empty.

Variables

View Source
var (
	// NotificationChannel stores the Events for notifications
	NotificationChannel chan amqp.Delivery
	// KeyManagerChannel stores the key manager eventsv
	KeyManagerChannel chan amqp.Delivery
	// RevokedTokenChannel stores the revoked token events
	RevokedTokenChannel chan amqp.Delivery
	// ThrottleDataChannel stores the throttling related events
	ThrottleDataChannel chan amqp.Delivery
)
View Source
var EventListeningEndpoints []string

EventListeningEndpoints represents the list of endpoints

View Source
var (

	// RabbitConn represents the ampq connection
	RabbitConn *amqp.Connection
)

Functions

func InitiateJMSConnection

func InitiateJMSConnection(eventListeningEndpoints []string) error

InitiateJMSConnection to pass event consumption

Types

type APIEvent

type APIEvent struct {
	APIID         int      `json:"apiId"`
	UUID          string   `json:"uuid"`
	GatewayLabels []string `json:"gatewayLabels"`
	APIVersion    string   `json:"apiVersion"`
	APIContext    string   `json:"apiContext"`
	APIName       string   `json:"apiName"`
	APIProvider   string   `json:"apiProvider"`
	APIStatus     string   `json:"apiStatus"`
	APIType       string   `json:"apiType"`
	Event
	// TODO: (VirajSalaka) Remove this when the event is fixed from APIM side
	Version string `json:"version"`
	Context string `json:"context"`
	Name    string `json:"name"`
	Action  string `json:"action"`
}

APIEvent for struct API events

type APIPolicyEvent

type APIPolicyEvent struct {
	PolicyInfo
	AddedConditionGroupIds   string `json:"addedConditionGroupIds"`
	DeletedConditionGroupIds string `json:"deletedConditionGroupIds"`
}

APIPolicyEvent for struct API policy events

type ApplicationEvent

type ApplicationEvent struct {
	UUID              string      `json:"uuid"`
	ApplicationID     int32       `json:"applicationId"`
	ApplicationName   string      `json:"applicationName"`
	TokenType         string      `json:"tokenType"`
	ApplicationPolicy string      `json:"applicationPolicy"`
	Attributes        interface{} `json:"attributes"`
	Subscriber        string      `json:"subscriber"`
	Event
}

ApplicationEvent for struct application events

type ApplicationRegistrationEvent

type ApplicationRegistrationEvent struct {
	ApplicationID   int32  `json:"applicationId"`
	ApplicationUUID string `json:"applicationUUID"`
	ConsumerKey     string `json:"consumerKey"`
	KeyType         string `json:"keyType"`
	KeyManager      string `json:"keyManager"`
	Event
}

ApplicationRegistrationEvent for struct application registration events

type Claim

type Claim struct {
	// contains filtered or unexported fields
}

Claim for struct

type Consumer

type Consumer struct {
	Conn    *amqp.Connection
	Channel *amqp.Channel
	Tag     string
	Done    chan error
}

Consumer struct represents the structure of a consumer object

func (*Consumer) Shutdown

func (c *Consumer) Shutdown() error

Shutdown when error happens

type Event

type Event struct {
	EventID      string `json:"eventId"`
	TimeStamp    int64  `json:"timeStamp"`
	Type         string `json:"type"`
	TenantID     int32  `json:"tenantId"`
	TenantDomain string `json:"tenantDomain"`
}

Event for struct abstract event

type EventKeyManagerNotification

type EventKeyManagerNotification struct {
	Event struct {
		PayloadData struct {
			EventType    string `json:"event_type"`
			Name         string `json:"name"`
			Action       string `json:"action"`
			Type         string `json:"type"`
			Enabled      bool   `json:"enabled"`
			Value        string `json:"value"`
			TenantID     string `json:"tenantId,omitempty"`
			TenantDomain string `json:"tenantDomain,omitempty"`
		} `json:"payloadData"`
	} `json:"event"`
}

EventKeyManagerNotification for struct

type EventNotification

type EventNotification struct {
	Event struct {
		PayloadData struct {
			EventType string  `json:"eventType"`
			Timstamp  float64 `json:"timeStamp"`
			Event     string  `json:"event"`
		} `json:"payloadData"`
	} `json:"event"`
}

EventNotification for struct event notifications

type EventOrganizationPurge

type EventOrganizationPurge struct {
	Event struct {
		PayloadData struct {
			EventType        string         `json:"eventType"`
			TimeStamp        int64          `json:"timestamp"`
			OrganizationList []Organization `json:"organizationList"`
		} `json:"payloadData"`
	} `json:"event"`
}

EventOrganizationPurge for struct

type EventThrottleData

type EventThrottleData struct {
	Event struct {
		PayloadData struct {
			KeyTemplateValue  string `json:"keyTemplateValue"`
			KeyTemplateState  string `json:"keyTemplateState"`
			ID                int32  `json:"id"`
			BlockingCondition string `json:"blockingCondition"`
			ConditionValue    string `json:"conditionValue"`
			State             string `json:"state"`
			TenantDomain      string `json:"tenantDomain"`
		} `json:"payloadData"`
	} `json:"event"`
}

EventThrottleData for struct throttle events

type EventTokenRevocationNotification

type EventTokenRevocationNotification struct {
	Event struct {
		PayloadData struct {
			EventID      string `json:"eventId"`
			RevokedToken string `json:"revokedToken"`
			TTL          string `json:"ttl"`
			ExpiryTime   int64  `json:"expiryTime"`
			Type         string `json:"type"`
			TenantID     int    `json:"tenantId"`
		} `json:"payloadData"`
	} `json:"event"`
}

EventTokenRevocationNotification for struct

type KeyManagerEvent

type KeyManagerEvent struct {
	ServerURL                  string   `json:"ServerURL"`
	ValidationEnable           bool     `json:"validation_enable"`
	ClaimMappings              []Claim  `json:"Claim"`
	GrantTypes                 []string `json:"grant_types"`
	EncryptPersistedTokens     bool     `json:"OAuthConfigurations.EncryptPersistedTokens"`
	EnableOauthAppCreation     bool     `json:"enable_oauth_app_creation"`
	ValidityPeriod             string   `json:"VALIDITY_PERIOD"`
	CertificateValue           string   `json:"certificate_value"`
	EnableTokenGeneration      bool     `json:"enable_token_generation"`
	Issuer                     string   `json:"issuer"`
	EnableMapOauthConsumerApps bool     `json:"enable_map_oauth_consumer_apps"`
	EnableTokenHash            bool     `json:"enable_token_hash"`
	SelfValidateJwt            bool     `json:"self_validate_jwt"`
	RevokeEndpoint             string   `json:"revoke_endpoint"`
	EnableTokenEncryption      bool     `json:"enable_token_encryption"`
	RevokeURL                  string   `json:"RevokeURL"`
	TokenURL                   string   `json:"TokenURL"`
	TokenFormatString          string   `json:"token_format_string"`
	CertificateType            string   `json:"certificate_type"`
	TokenEndpoint              string   `json:"token_endpoint"`
}

KeyManagerEvent for struct

type Organization

type Organization struct {
	ID     string `json:"id"`
	UUID   string `json:"uuid"`
	Handle string `json:"handle"`
	Name   string `json:"name"`
}

Organization for struct

type PolicyInfo

type PolicyInfo struct {
	PolicyID   int32  `json:"policyId"`
	PolicyName string `json:"policyName"`
	QuotaType  string `json:"quotaType"`
	PolicyType string `json:"policyType"`
	Event
}

PolicyInfo for struct policy Info events

type ScopeEvent

type ScopeEvent struct {
	Name            string `json:"name"`
	DisplayName     string `json:"displayName"`
	ApplicationName string `json:"description"`
	Event
}

ScopeEvent for struct scope events

type SubscriptionEvent

type SubscriptionEvent struct {
	SubscriptionID    int32  `json:"subscriptionId"`
	SubscriptionUUID  string `json:"subscriptionUUID"`
	APIID             int32  `json:"apiId"`
	APIUUID           string `json:"apiUUID"`
	ApplicationID     int32  `json:"applicationId"`
	ApplicationUUID   string `json:"applicationUUID"`
	PolicyID          string `json:"policyId"`
	SubscriptionState string `json:"subscriptionState"`
	APIName           string `json:"apiName"`
	APIVersion        string `json:"apiVersion"`
	Event
}

SubscriptionEvent for struct subscription events

type SubscriptionPolicyEvent

type SubscriptionPolicyEvent struct {
	PolicyInfo
	RateLimitCount       int32  `json:"rateLimitCount"`
	RateLimitTimeUnit    string `json:"rateLimitTimeUnit"`
	StopOnQuotaReach     bool   `json:"stopOnQuotaReach"`
	GraphQLMaxComplexity int32  `json:"graphQLMaxComplexity"`
	GraphQLMaxDepth      int32  `json:"graphQLMaxDepth"`
}

SubscriptionPolicyEvent for struct subscriptionPolicy events

Jump to

Keyboard shortcuts

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