gevent

package
v0.15.14 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GrantCreatedType   = "grant.created"
	GrantActivatedType = "grant.activated"
	GrantExpiredType   = "grant.expired"
	GrantRevokedType   = "grant.revoked"
	GrantFailedType    = "grant.failed"
)
View Source
const (
	RequestCreatedType   = "request.created"
	RequestApprovedType  = "request.approved"
	RequestCancelledType = "request.cancelled"
	RequestDeclinedType  = "request.declined"
)

Variables

This section is empty.

Functions

func ToEntry

func ToEntry(e EventTyper, eventBusName string) (types.PutEventsRequestEntry, error)

ToEntry returns an EventBridge PutEventsRequestEntry with the 'Detail', 'DetailType', and 'Source' fields filled in based on the event.

Types

type EventTyper

type EventTyper interface {
	EventType() string
}

type GrantActivated

type GrantActivated struct {
	Grant types.Grant `json:"grant"`
}

GrantActivated is emitted when a grant is activated by the Access Handler. 'Activated' means that the assignment to the resource was completed successfully.

func (GrantActivated) EventType

func (GrantActivated) EventType() string

type GrantCreated

type GrantCreated struct {
	Grant types.Grant `json:"grant"`
}

GrantCreated is emitted when a new grant is created by the Access Handler.

func (GrantCreated) EventType

func (GrantCreated) EventType() string

type GrantEventPayload

type GrantEventPayload struct {
	Grant types.Grant `json:"grant"`
}

GrantEventPayload is a payload which is common to all Grant events. It is used to conveniently unmarshal the Grant payloads in our event handler code.

type GrantExpired

type GrantExpired struct {
	Grant types.Grant `json:"grant"`
}

GrantExpired is emitted when a grant is expired by the Access Handler. 'Expired' means that the assignment to the resource was removed successfully, at the time that the grant was supposed to end.

func (GrantExpired) EventType

func (GrantExpired) EventType() string

type GrantFailed

type GrantFailed struct {
	Grant types.Grant `json:"grant"`
	// Reason contains details about why the grant failed.
	Reason string `json:"reason"`
}

GrantFailed is emitted when the access handler encounters an unrecoverable error when activating or deactivating a grant.

func (GrantFailed) EventType

func (GrantFailed) EventType() string

type GrantRevoked

type GrantRevoked struct {
	Grant types.Grant `json:"grant"`
	// the commonfate internal id of the actor who revoked the grant
	Actor string `json:"actor"`
	// the email address of the actor who revoked the grant
	RevokerEmail string `json:"revokerEmail"`
}

GrantRevoked is emitted when a grant is revoked by the Access Handler. 'Revoked' means that the assignment to the resource was removed successfully before the time that the grant was supposed to end.

The GrantRevoked event is only emitted if Common Fate is used to revoke access. If you manually remove the resource assignment in the provider directly (such as removing the user from the Okta group which they were granted access to), this event will not be emitted.

func (GrantRevoked) EventType

func (GrantRevoked) EventType() string

type RequestApproved

type RequestApproved struct {
	Request       access.Request `json:"request"`
	ReviewerID    string         `json:"reviewerId"`
	ReviewerEmail string         `json:"reviewerEmail"`
}

RequestApproved is emitted when a user's request is approved.

func (RequestApproved) EventType

func (RequestApproved) EventType() string

type RequestCancelled

type RequestCancelled struct {
	Request access.Request `json:"request"`
}

func (RequestCancelled) EventType

func (RequestCancelled) EventType() string

type RequestCreated

type RequestCreated struct {
	Request        access.Request `json:"request"`
	RequestorEmail string         `json:"requestorEmail"`
}

RequestCreated is emitted when a user requests access to something in the Common Fate service.

func (RequestCreated) EventType

func (RequestCreated) EventType() string

type RequestDeclined

type RequestDeclined struct {
	Request       access.Request `json:"request"`
	ReviewerID    string         `json:"reviewerId"`
	ReviewerEmail string         `json:"reviewerEmail"`
}

func (RequestDeclined) EventType

func (RequestDeclined) EventType() string

type RequestEventPayload

type RequestEventPayload struct {
	Request    access.Request `json:"request"`
	ReviewerID string         `json:"reviewerId"`
}

RequestEventPayload is a payload which is common to all Request events. It is used to conveniently unmarshal the Request payloads in our event handler code.

type Sender

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

EventSender provides methods to submit events to a Common Fate EventBridge bus.

func NewSender

func NewSender(ctx context.Context, opts SenderOpts) (*Sender, error)

NewSender creates a new Sender

func (*Sender) Put

func (s *Sender) Put(ctx context.Context, e EventTyper) error

type SenderOpts

type SenderOpts struct {
	EventBusARN string
}

Jump to

Keyboard shortcuts

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