Documentation ¶
Index ¶
- Constants
- Variables
- type AsyncDenoClient
- type AsyncHTTPClient
- type CheckRequest
- type CheckResponse
- type CustomAttributesServiceNoEvent
- type DenoClient
- type DenoClientImpl
- type DenoFileDescriptor
- func (d DenoFileDescriptor) FindResources(fs resource.Fs) ([]resource.Location, error)
- func (DenoFileDescriptor) MatchResource(path string) (*resource.Match, bool)
- func (DenoFileDescriptor) UpdateResource(ctx context.Context, _ []resource.ResourceFile, resrc *resource.ResourceFile, ...) (*resource.ResourceFile, error)
- func (DenoFileDescriptor) ViewResources(resources []resource.ResourceFile, rawView resource.View) (interface{}, error)
- type DenoHook
- type DenoHookLogger
- type EventDenoHook
- type EventDenoHookImpl
- type EventWebHook
- type EventWebHookImpl
- type Logger
- type OperationDisallowedItem
- type ResourceManager
- type RolesAndGroupsServiceNoEvent
- type RunRequest
- type RunResponse
- type Sink
- func (s *Sink) DeliverBlockingEvent(ctx context.Context, e *event.Event) error
- func (s *Sink) DeliverNonBlockingEvent(ctx context.Context, e *event.Event) error
- func (s *Sink) ReceiveBlockingEvent(ctx context.Context, e *event.Event) (err error)
- func (s *Sink) ReceiveNonBlockingEvent(ctx context.Context, e *event.Event) (err error)
- func (s *Sink) WillDeliverBlockingEvent(eventType event.Type) bool
- func (s *Sink) WillDeliverNonBlockingEvent(eventType event.Type) bool
- type StandardAttributesServiceNoEvent
- type Stream
- type SyncDenoClient
- type SyncHTTPClient
- type WebHook
- type WebHookImpl
- func (h *WebHookImpl) PerformNoResponse(client *http.Client, request *http.Request) error
- func (h *WebHookImpl) PerformWithResponse(client *http.Client, request *http.Request) (resp *http.Response, err error)
- func (h *WebHookImpl) PrepareRequest(ctx context.Context, u *url.URL, body interface{}) (*http.Request, error)
- func (h *WebHookImpl) SupportURL(u *url.URL) bool
- type WebHookLogger
Constants ¶
View Source
const HeaderRequestBodySignature = "x-authgear-body-signature"
Variables ¶
View Source
var ContextKeyDenoClient = denoClientContextKeyType{}
View Source
var DenoCheckError = apierrors.Invalid.WithReason("DenoCheckError")
View Source
var DenoFile = resource.RegisterResource(DenoFileDescriptor{})
View Source
var DenoFileFilenameRegexp = regexp.MustCompile(`^deno/[.0-9a-zA-Z]+\.ts$`)
View Source
var DenoRunError = apierrors.BadRequest.WithReason("DenoRunError")
View Source
var DependencySet = wire.NewSet( NewSyncHTTPClient, NewAsyncHTTPClient, NewSyncDenoClient, NewAsyncDenoClient, NewLogger, NewWebHookLogger, NewDenoHookLogger, wire.Struct(new(Sink), "*"), wire.Bind(new(WebHook), new(*WebHookImpl)), wire.Struct(new(WebHookImpl), "*"), wire.Bind(new(EventWebHook), new(*EventWebHookImpl)), wire.Struct(new(EventWebHookImpl), "*"), wire.Struct(new(DenoHook), "*"), wire.Bind(new(EventDenoHook), new(*EventDenoHookImpl)), wire.Struct(new(EventDenoHookImpl), "*"), )
View Source
var WebHookDeliveryTimeout = apierrors.InternalError.WithReason("WebHookDeliveryTimeout")
View Source
var WebHookDisallowed = apierrors.Forbidden.WithReason("WebHookDisallowed")
View Source
var WebHookInvalidResponse = apierrors.InternalError.WithReason("WebHookInvalidResponse")
Functions ¶
This section is empty.
Types ¶
type AsyncDenoClient ¶
type AsyncDenoClient interface { DenoClient }
func NewAsyncDenoClient ¶
func NewAsyncDenoClient(endpoint config.DenoEndpoint, logger Logger) AsyncDenoClient
type AsyncHTTPClient ¶
func NewAsyncHTTPClient ¶
func NewAsyncHTTPClient() AsyncHTTPClient
type CheckRequest ¶
type CheckRequest struct {
Script string `json:"script"`
}
type CheckResponse ¶
type CheckResponse struct {
Stderr string `json:"stderr,omitempty"`
}
type DenoClient ¶
type DenoClientImpl ¶
type DenoFileDescriptor ¶
type DenoFileDescriptor struct{}
func (DenoFileDescriptor) FindResources ¶
func (DenoFileDescriptor) MatchResource ¶
func (DenoFileDescriptor) MatchResource(path string) (*resource.Match, bool)
func (DenoFileDescriptor) UpdateResource ¶
func (DenoFileDescriptor) UpdateResource(ctx context.Context, _ []resource.ResourceFile, resrc *resource.ResourceFile, data []byte) (*resource.ResourceFile, error)
func (DenoFileDescriptor) ViewResources ¶
func (DenoFileDescriptor) ViewResources(resources []resource.ResourceFile, rawView resource.View) (interface{}, error)
type DenoHook ¶
type DenoHook struct { ResourceManager ResourceManager Logger DenoHookLogger }
type DenoHookLogger ¶
func NewDenoHookLogger ¶
func NewDenoHookLogger(lf *log.Factory) DenoHookLogger
type EventDenoHook ¶
type EventDenoHookImpl ¶
type EventDenoHookImpl struct { DenoHook SyncDenoClient SyncDenoClient AsyncDenoClient AsyncDenoClient }
func (*EventDenoHookImpl) DeliverBlockingEvent ¶
func (h *EventDenoHookImpl) DeliverBlockingEvent(ctx context.Context, u *url.URL, e *event.Event) (*event.HookResponse, error)
func (*EventDenoHookImpl) DeliverNonBlockingEvent ¶
type EventWebHook ¶
type EventWebHookImpl ¶
type EventWebHookImpl struct { WebHookImpl SyncHTTP SyncHTTPClient AsyncHTTP AsyncHTTPClient }
func (*EventWebHookImpl) DeliverBlockingEvent ¶
func (h *EventWebHookImpl) DeliverBlockingEvent(ctx context.Context, u *url.URL, e *event.Event) (*event.HookResponse, error)
func (*EventWebHookImpl) DeliverNonBlockingEvent ¶
type OperationDisallowedItem ¶
type ResourceManager ¶
type ResourceManager interface {
Read(desc resource.Descriptor, view resource.View) (interface{}, error)
}
type RolesAndGroupsServiceNoEvent ¶
type RolesAndGroupsServiceNoEvent interface { ResetUserRole(ctx context.Context, options *rolesgroups.ResetUserRoleOptions) error ResetUserGroup(ctx context.Context, options *rolesgroups.ResetUserGroupOptions) error }
type RunRequest ¶
type RunRequest struct { Script string `json:"script"` Input interface{} `json:"input"` }
type RunResponse ¶
type Sink ¶
type Sink struct { Logger Logger Config *config.HookConfig Clock clock.Clock EventWebHook EventWebHook EventDenoHook EventDenoHook StandardAttributes StandardAttributesServiceNoEvent CustomAttributes CustomAttributesServiceNoEvent RolesAndGroups RolesAndGroupsServiceNoEvent }
func (*Sink) DeliverBlockingEvent ¶
func (*Sink) DeliverNonBlockingEvent ¶
func (*Sink) ReceiveBlockingEvent ¶
func (*Sink) ReceiveNonBlockingEvent ¶
func (*Sink) WillDeliverBlockingEvent ¶
type SyncDenoClient ¶
type SyncDenoClient interface { DenoClient }
func NewSyncDenoClient ¶
func NewSyncDenoClient(endpoint config.DenoEndpoint, c *config.HookConfig, logger Logger) SyncDenoClient
type SyncHTTPClient ¶
func NewSyncHTTPClient ¶
func NewSyncHTTPClient(c *config.HookConfig) SyncHTTPClient
type WebHook ¶
type WebHook interface { SupportURL(u *url.URL) bool PrepareRequest(ctx context.Context, u *url.URL, body interface{}) (*http.Request, error) PerformWithResponse(client *http.Client, request *http.Request) (resp *http.Response, err error) PerformNoResponse(client *http.Client, request *http.Request) error }
type WebHookImpl ¶
type WebHookImpl struct { Logger WebHookLogger Secret *config.WebhookKeyMaterials }
func (*WebHookImpl) PerformNoResponse ¶
func (*WebHookImpl) PerformWithResponse ¶
func (h *WebHookImpl) PerformWithResponse( client *http.Client, request *http.Request) (resp *http.Response, err error)
The caller should close the response body if the response is not nil.
func (*WebHookImpl) PrepareRequest ¶
func (*WebHookImpl) SupportURL ¶
func (h *WebHookImpl) SupportURL(u *url.URL) bool
type WebHookLogger ¶
func NewWebHookLogger ¶
func NewWebHookLogger(lf *log.Factory) WebHookLogger
Click to show internal directories.
Click to hide internal directories.