http

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package http provides HTTP handlers for tokenization key management and token operations.

Package http provides HTTP handlers for tokenization key management and token operations.

Package http provides HTTP handlers for tokenization key management and token operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TokenizationHandler

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

TokenizationHandler handles HTTP requests for tokenization operations. Coordinates tokenize, detokenize, validate, and revoke operations with TokenizationUseCase.

func NewTokenizationHandler

func NewTokenizationHandler(
	tokenizationUseCase tokenizationUseCase.TokenizationUseCase,
	logger *slog.Logger,
) *TokenizationHandler

NewTokenizationHandler creates a new tokenization handler with required dependencies.

func (*TokenizationHandler) DetokenizeHandler

func (h *TokenizationHandler) DetokenizeHandler(c *gin.Context)

DetokenizeHandler retrieves the original plaintext value for a given token. POST /v1/tokenization/detokenize - Requires DecryptCapability. Returns 200 OK with base64-encoded plaintext and metadata.

func (*TokenizationHandler) RevokeHandler

func (h *TokenizationHandler) RevokeHandler(c *gin.Context)

RevokeHandler marks a token as revoked, preventing further detokenization. POST /v1/tokenization/revoke - Requires DeleteCapability. Returns 204 No Content on success.

func (*TokenizationHandler) TokenizeHandler

func (h *TokenizationHandler) TokenizeHandler(c *gin.Context)

TokenizeHandler generates a token for the given plaintext value using the named key. POST /v1/tokenization/keys/:name/tokenize - Requires EncryptCapability. In deterministic mode, returns existing token if the value has been tokenized before. Returns 201 Created with token and metadata.

func (*TokenizationHandler) ValidateHandler

func (h *TokenizationHandler) ValidateHandler(c *gin.Context)

ValidateHandler checks if a token exists and is valid (not expired or revoked). POST /v1/tokenization/validate - Requires ReadCapability. Returns 200 OK with validation result.

type TokenizationKeyHandler

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

TokenizationKeyHandler handles HTTP requests for tokenization key management operations. Coordinates key creation, rotation, and deletion with TokenizationKeyUseCase.

func NewTokenizationKeyHandler

func NewTokenizationKeyHandler(
	keyUseCase tokenizationUseCase.TokenizationKeyUseCase,
	logger *slog.Logger,
) *TokenizationKeyHandler

NewTokenizationKeyHandler creates a new tokenization key handler with required dependencies.

func (*TokenizationKeyHandler) CreateHandler

func (h *TokenizationKeyHandler) CreateHandler(c *gin.Context)

CreateHandler creates a new tokenization key with version 1. POST /v1/tokenization/keys - Requires WriteCapability. Returns 201 Created with key details.

func (*TokenizationKeyHandler) DeleteHandler

func (h *TokenizationKeyHandler) DeleteHandler(c *gin.Context)

DeleteHandler soft-deletes a tokenization key by ID. DELETE /v1/tokenization/keys/:id - Requires DeleteCapability. Returns 204 No Content on success.

func (*TokenizationKeyHandler) RotateHandler

func (h *TokenizationKeyHandler) RotateHandler(c *gin.Context)

RotateHandler creates a new version of an existing tokenization key. POST /v1/tokenization/keys/:name/rotate - Requires WriteCapability. Returns 201 Created with new key version.

Directories

Path Synopsis
Package dto provides data transfer objects for HTTP request and response handling.
Package dto provides data transfer objects for HTTP request and response handling.

Jump to

Keyboard shortcuts

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