validation

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2024 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSentinel

func IsSentinel(
	j data.JournalEntry, cid string, spiffeid string,
) (bool, func(http.ResponseWriter))

IsSentinel evaluates if a given SPIFFE ID corresponds to a VSecM Sentinel entity. It logs the operation and, if the SPIFFE ID is not recognized as VSecM Sentinel, logs an error event and sends an HTTP bad request response.

Parameters:

  • j: An instance of journal.Entry which is an audit log.
  • cid: A string representing the correlation ID for the operation, used primarily for logging.
  • spiffeid: A string representing the SPIFFE ID to be validated against sentinel conditions.

Returns:

  • bool: Returns true if the SPIFFE ID is a sentinel, otherwise false.
  • func(http.ResponseWriter): Returns an HTTP handler function. If the SPIFFE ID represents VSecM Sentinel, the handler is a no-op. If the SPIFFE ID is not for VSecM Sentinel, it returns a handler that responds with HTTP 400 Bad Request and logs the error if the response writing fails.

Note: This function should be used in scenarios where SPIFFE ID validation is critical for further processing steps, and appropriate HTTP response behavior needs to be enforced based on the validation results.

Types

This section is empty.

Jump to

Keyboard shortcuts

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