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(ctx context.Context, resources []resource.ResourceFile, rawView resource.View) (interface{}, error)
- type DenoHook
- type ErrorCode
- type EventDenoHook
- type EventDenoHookImpl
- type EventWebHook
- type EventWebHookImpl
- 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(ctx context.Context, client *http.Client, request *http.Request) error
- func (h *WebHookImpl) PerformWithResponse(ctx context.Context, 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
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 DenoClientLogger = slogutil.NewLogger("deno-client")
View Source
var DenoFile = resource.RegisterResource(DenoFileDescriptor{})
View Source
var DenoFileFilenameRegexp = regexp.MustCompile(`^deno/[.0-9a-zA-Z]+\.ts$`)
View Source
var DenoHookLogger = slogutil.NewLogger("deno-hook")
View Source
var DenoRunError = apierrors.BadRequest.WithReason("DenoRunError")
View Source
var DependencySet = wire.NewSet( NewSyncHTTPClient, NewAsyncHTTPClient, NewSyncDenoClient, NewAsyncDenoClient, 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 HookDeliveryTimeout = apierrors.InternalError.WithReason("HookDeliveryTimeout").SkipLoggingToExternalService()
View Source
var HookDeliveryUnknownFailure = apierrors.InternalError.WithReason("HookDeliveryUnknownFailure").SkipLoggingToExternalService()
View Source
var HookDisallowed = apierrors.Forbidden.WithReason("HookDisallowed")
View Source
var HookInvalidResponse = apierrors.InternalError.WithReason("HookInvalidResponse").SkipLoggingToExternalService()
View Source
var SinkLogger = slogutil.NewLogger("hook-sink")
View Source
var WebHookLogger = slogutil.NewLogger("webhook")
Functions ¶
This section is empty.
Types ¶
type AsyncDenoClient ¶
type AsyncDenoClient interface {
DenoClient
}
func NewAsyncDenoClient ¶
func NewAsyncDenoClient(endpoint config.DenoEndpoint) 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(ctx context.Context, resources []resource.ResourceFile, rawView resource.View) (interface{}, error)
type DenoHook ¶
type DenoHook struct {
ResourceManager ResourceManager
}
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 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 {
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) 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(ctx context.Context, client *http.Client, request *http.Request) (resp *http.Response, err error)
PerformNoResponse(ctx context.Context, client *http.Client, request *http.Request) error
}
type WebHookImpl ¶
type WebHookImpl struct {
Secret *config.WebhookKeyMaterials
}
func (*WebHookImpl) PerformNoResponse ¶
func (*WebHookImpl) PerformWithResponse ¶
func (h *WebHookImpl) PerformWithResponse( ctx context.Context, 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
Click to show internal directories.
Click to hide internal directories.