policy

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreatePolicyHandler

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

func NewCreatePolicyHandler

func NewCreatePolicyHandler(creator apppolicy.Creator) *CreatePolicyHandler

func (*CreatePolicyHandler) Handle

func (h *CreatePolicyHandler) Handle(c *fiber.Ctx) error

Handle godoc @Summary Create a policy @Description Creates a new policy in a gateway. @Tags policies @Accept json @Produce json @Security BearerAuth @Param gateway_id path string true "Gateway id" format(uuid) @Param body body request.CreatePolicyRequest true "Policy to create" @Success 201 {object} response.PolicyResponse @Failure 400 {object} helpers.ErrorBody @Failure 401 {object} helpers.ErrorBody @Failure 404 {object} helpers.ErrorBody @Failure 409 {object} helpers.ErrorBody @Router /v1/gateways/{gateway_id}/policies [post]

type DeletePolicyHandler

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

func NewDeletePolicyHandler

func NewDeletePolicyHandler(deleter apppolicy.Deleter) *DeletePolicyHandler

func (*DeletePolicyHandler) Handle

func (h *DeletePolicyHandler) Handle(c *fiber.Ctx) error

Handle godoc @Summary Delete a policy @Description Deletes a policy from a gateway. @Tags policies @Produce json @Security BearerAuth @Param gateway_id path string true "Gateway id" format(uuid) @Param id path string true "Policy id" format(uuid) @Success 204 "No Content" @Failure 400 {object} helpers.ErrorBody @Failure 401 {object} helpers.ErrorBody @Failure 404 {object} helpers.ErrorBody @Failure 409 {object} helpers.ErrorBody @Router /v1/gateways/{gateway_id}/policies/{id} [delete]

type DuplicatePolicyHandler

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

func NewDuplicatePolicyHandler

func NewDuplicatePolicyHandler(duplicator apppolicy.Duplicator) *DuplicatePolicyHandler

func (*DuplicatePolicyHandler) Handle

func (h *DuplicatePolicyHandler) Handle(c *fiber.Ctx) error

Handle godoc @Summary Duplicate a policy @Description Creates a copy of an existing policy. The new policy reuses the plugin configuration (slug, settings, stages, enabled, priority, parallel) with a fresh id and an auto-generated name (suffix 2, 3, 4...). The copy has no consumer associations and is not global. @Tags policies @Produce json @Security BearerAuth @Param gateway_id path string true "Gateway id" format(uuid) @Param id path string true "Policy id" format(uuid) @Success 201 {object} response.PolicyResponse @Failure 400 {object} helpers.ErrorBody @Failure 401 {object} helpers.ErrorBody @Failure 404 {object} helpers.ErrorBody @Failure 409 {object} helpers.ErrorBody @Router /v1/gateways/{gateway_id}/policies/{id}/duplicate [post]

type GetPolicyHandler

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

func NewGetPolicyHandler

func NewGetPolicyHandler(finder apppolicy.Finder) *GetPolicyHandler

func (*GetPolicyHandler) Handle

func (h *GetPolicyHandler) Handle(c *fiber.Ctx) error

Handle godoc @Summary Get a policy @Description Returns a single policy by id. @Tags policies @Produce json @Security BearerAuth @Param gateway_id path string true "Gateway id" format(uuid) @Param id path string true "Policy id" format(uuid) @Success 200 {object} response.PolicyResponse @Failure 400 {object} helpers.ErrorBody @Failure 401 {object} helpers.ErrorBody @Failure 404 {object} helpers.ErrorBody @Router /v1/gateways/{gateway_id}/policies/{id} [get]

type GlobalPolicyHandler

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

func NewGlobalPolicyHandler

func NewGlobalPolicyHandler(scoper apppolicy.Scoper) *GlobalPolicyHandler

func (*GlobalPolicyHandler) SetGlobal

func (h *GlobalPolicyHandler) SetGlobal(c *fiber.Ctx) error

SetGlobal godoc @Summary Mark a policy as global @Description Promotes a policy to gateway-wide scope (applies to every consumer). @Tags policies @Produce json @Security BearerAuth @Param gateway_id path string true "Gateway id" format(uuid) @Param id path string true "Policy id" format(uuid) @Success 200 {object} response.PolicyResponse @Failure 400 {object} helpers.ErrorBody @Failure 401 {object} helpers.ErrorBody @Failure 404 {object} helpers.ErrorBody @Router /v1/gateways/{gateway_id}/policies/{id}/global [post]

func (*GlobalPolicyHandler) UnsetGlobal

func (h *GlobalPolicyHandler) UnsetGlobal(c *fiber.Ctx) error

UnsetGlobal godoc @Summary Clear a policy's global scope @Description Demotes a global policy back to consumer-scoped (applies only to linked consumers). @Tags policies @Produce json @Security BearerAuth @Param gateway_id path string true "Gateway id" format(uuid) @Param id path string true "Policy id" format(uuid) @Success 200 {object} response.PolicyResponse @Failure 400 {object} helpers.ErrorBody @Failure 401 {object} helpers.ErrorBody @Failure 404 {object} helpers.ErrorBody @Router /v1/gateways/{gateway_id}/policies/{id}/global [delete]

type ListPolicyHandler

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

func NewListPolicyHandler

func NewListPolicyHandler(finder apppolicy.Finder) *ListPolicyHandler

func (*ListPolicyHandler) Handle

func (h *ListPolicyHandler) Handle(c *fiber.Ctx) error

Handle godoc @Summary List policies @Description Returns a paginated list of policies in a gateway. @Tags policies @Produce json @Security BearerAuth @Param gateway_id path string true "Gateway id" format(uuid) @Param name query string false "Filter by name (substring match)" @Param page query int false "Page number (1-based)" @Param size query int false "Page size" @Success 200 {object} response.ListPolicyResponse @Failure 400 {object} helpers.ErrorBody @Failure 401 {object} helpers.ErrorBody @Router /v1/gateways/{gateway_id}/policies [get]

type UpdatePolicyHandler

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

func NewUpdatePolicyHandler

func NewUpdatePolicyHandler(updater apppolicy.Updater) *UpdatePolicyHandler

func (*UpdatePolicyHandler) Handle

func (h *UpdatePolicyHandler) Handle(c *fiber.Ctx) error

Handle godoc @Summary Update a policy @Description Updates an existing policy. @Tags policies @Accept json @Produce json @Security BearerAuth @Param gateway_id path string true "Gateway id" format(uuid) @Param id path string true "Policy id" format(uuid) @Param body body request.UpdatePolicyRequest true "Policy fields to update" @Success 200 {object} response.PolicyResponse @Failure 400 {object} helpers.ErrorBody @Failure 401 {object} helpers.ErrorBody @Failure 404 {object} helpers.ErrorBody @Failure 409 {object} helpers.ErrorBody @Router /v1/gateways/{gateway_id}/policies/{id} [put]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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