Documentation
¶
Index ¶
- func AddCustomLog(keyval *CustomLogKeyValue) lua.LGFunction
- func AddHTTPResponseHeader(ctx *gin.Context) lua.LGFunction
- func AddHTTPResponseHeaderWithCtx(ctx *gin.Context) lua.LGFunction
- func CheckBackendConnection(monitor monitoring.Monitor) lua.LGFunction
- func CompileLua(filePath string) (*lua.FunctionProto, error)
- func ContextDelete(ctx *Context) lua.LGFunction
- func ContextDeleteWithCtx(ctx *Context) lua.LGFunction
- func ContextGet(ctx *Context) lua.LGFunction
- func ContextGetWithCtx(ctx *Context) lua.LGFunction
- func ContextSet(ctx *Context) lua.LGFunction
- func ContextSetWithCtx(ctx *Context) lua.LGFunction
- func DoCompiledFile(L *lua.LState, proto *lua.FunctionProto) error
- func GetAllHTTPRequestHeaders(meta HTTPRequestMeta) lua.LGFunction
- func GetAllHTTPRequestHeadersWithMeta(meta HTTPRequestMeta) lua.LGFunction
- func GetHTTPMethod(meta HTTPRequestMeta) lua.LGFunction
- func GetHTTPMethodWithMeta(meta HTTPRequestMeta) lua.LGFunction
- func GetHTTPPath(meta HTTPRequestMeta) lua.LGFunction
- func GetHTTPPathWithMeta(meta HTTPRequestMeta) lua.LGFunction
- func GetHTTPQueryParam(meta HTTPRequestMeta) lua.LGFunction
- func GetHTTPQueryParamWithMeta(meta HTTPRequestMeta) lua.LGFunction
- func GetHTTPRequestBody(meta HTTPRequestMeta) lua.LGFunction
- func GetHTTPRequestBodyWithMeta(meta HTTPRequestMeta) lua.LGFunction
- func GetHTTPRequestHeader(meta HTTPRequestMeta) lua.LGFunction
- func GetHTTPRequestHeaderWithMeta(meta HTTPRequestMeta) lua.LGFunction
- func HTTPData(ctx *gin.Context) lua.LGFunction
- func HTTPDataWithCtx(ctx *gin.Context) lua.LGFunction
- func HTTPHTML(ctx *gin.Context) lua.LGFunction
- func HTTPHTMLWithCtx(ctx *gin.Context) lua.LGFunction
- func HTTPRedirect(ctx *gin.Context) lua.LGFunction
- func HTTPRedirectWithCtx(ctx *gin.Context) lua.LGFunction
- func HTTPString(ctx *gin.Context) lua.LGFunction
- func HTTPStringWithCtx(ctx *gin.Context) lua.LGFunction
- func LoaderBackendStateless() lua.LGFunction
- func LoaderContextStateless() lua.LGFunction
- func LoaderDNSStateless() lua.LGFunction
- func LoaderHTTPRequestStateless() lua.LGFunction
- func LoaderHTTPResponseStateless() lua.LGFunction
- func LoaderLDAPStateless() lua.LGFunction
- func LoaderModCache(L *lua.LState) int
- func LoaderModContext(ctx *Context) lua.LGFunction
- func LoaderModDNS(ctx context.Context) lua.LGFunction
- func LoaderModHTTP(meta HTTPRequestMeta) lua.LGFunction
- func LoaderModHTTPResponse(ctx *gin.Context) lua.LGFunction
- func LoaderModMail(L *lua.LState) int
- func LoaderModMisc(L *lua.LState) int
- func LoaderModOTEL(ctx context.Context) lua.LGFunction
- func LoaderModPassword(L *lua.LState) int
- func LoaderModSoftWhitelist(L *lua.LState) int
- func LoaderOTELStateless() lua.LGFunction
- func MergeStatusAndLogs(statusSet *bool, reqLogs **CustomLogKeyValue, reqStatus **string, ...)
- func PackagePath(L *lua.LState) error
- func PutCommonRequest(cr *CommonRequest)
- func RegisterBackendResultType(L *lua.LState, methods ...string)
- func RemoveHTTPResponseHeader(ctx *gin.Context) lua.LGFunction
- func RemoveHTTPResponseHeaderWithCtx(ctx *gin.Context) lua.LGFunction
- func Resolve(ctx context.Context) lua.LGFunction
- func SendMail(smtpClient smtp.Client) lua.LGFunction
- func SetHTTPContentType(ctx *gin.Context) lua.LGFunction
- func SetHTTPContentTypeWithCtx(ctx *gin.Context) lua.LGFunction
- func SetHTTPResponseHeader(ctx *gin.Context) lua.LGFunction
- func SetHTTPResponseHeaderWithCtx(ctx *gin.Context) lua.LGFunction
- func SetHTTPStatus(ctx *gin.Context) lua.LGFunction
- func SetHTTPStatusWithCtx(ctx *gin.Context) lua.LGFunction
- func SetStatusMessage(status **string) lua.LGFunction
- func StopGlobalCache()
- func WriteHTTPResponseBody(ctx *gin.Context) lua.LGFunction
- func WriteHTTPResponseBodyWithCtx(ctx *gin.Context) lua.LGFunction
- type CommonRequest
- type Context
- func (c *Context) Deadline() (deadline time.Time, ok bool)
- func (c *Context) Delete(key string)
- func (c *Context) Done() <-chan struct{}
- func (c *Context) Err() error
- func (c *Context) Get(key string) any
- func (c *Context) GetExists(key string) (any, bool)
- func (c *Context) Set(key string, value any)
- func (c *Context) Value(_ any) lua.LValue
- type CustomLogKeyValue
- type Done
- type HTTPRequestMeta
- type LuaBackendResult
- type MailModule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCustomLog ¶
func AddCustomLog(keyval *CustomLogKeyValue) lua.LGFunction
AddCustomLog creates a Lua function that appends a key-value pair to a CustomLogKeyValue slice for logging purposes.
func AddHTTPResponseHeader ¶ added in v1.8.5
func AddHTTPResponseHeader(ctx *gin.Context) lua.LGFunction
AddHTTPResponseHeader returns a Lua function that adds a value to an HTTP response header Usage from Lua: nauthilus_http_response.add_http_response_header(name, value)
func AddHTTPResponseHeaderWithCtx ¶ added in v1.11.0
func AddHTTPResponseHeaderWithCtx(ctx *gin.Context) lua.LGFunction
AddHTTPResponseHeaderWithCtx is a factory alias that returns the same function as AddHTTPResponseHeader(ctx).
func CheckBackendConnection ¶
func CheckBackendConnection(monitor monitoring.Monitor) lua.LGFunction
CheckBackendConnection verifies the connection to a backend server using the provided configurations in the Lua table.
func CompileLua ¶
func CompileLua(filePath string) (*lua.FunctionProto, error)
CompileLua reads the passed lua file from disk and compiles it.
func ContextDelete ¶
func ContextDelete(ctx *Context) lua.LGFunction
ContextDelete is a wrapper function to Context.Delete(...). The argument ctx provides the Lua context for the underlying Lua function.
func ContextDeleteWithCtx ¶ added in v1.11.0
func ContextDeleteWithCtx(ctx *Context) lua.LGFunction
ContextDeleteWithCtx is a factory alias that returns the same function as ContextDelete(ctx).
func ContextGet ¶
func ContextGet(ctx *Context) lua.LGFunction
ContextGet is a wrapper function to Context.Get(...). The argument ctx provides the Lua context for the underlying Lua function.
func ContextGetWithCtx ¶ added in v1.11.0
func ContextGetWithCtx(ctx *Context) lua.LGFunction
ContextGetWithCtx is a factory alias that returns the same function as ContextGet(ctx).
func ContextSet ¶
func ContextSet(ctx *Context) lua.LGFunction
ContextSet is a wrapper function to Context.Set(...). The argument ctx provides the Lua context for the underlying Lua function.
func ContextSetWithCtx ¶ added in v1.11.0
func ContextSetWithCtx(ctx *Context) lua.LGFunction
ContextSetWithCtx is a factory alias that returns the same function as ContextSet(ctx).
func DoCompiledFile ¶
func DoCompiledFile(L *lua.LState, proto *lua.FunctionProto) error
DoCompiledFile takes a FunctionProto, as returned by CompileLua, and runs it in the LState. It is equivalent to calling DoFile on the LState with the original source file.
func GetAllHTTPRequestHeaders ¶
func GetAllHTTPRequestHeaders(meta HTTPRequestMeta) lua.LGFunction
GetAllHTTPRequestHeaders returns a Lua function that retrieves all headers from an HTTP request. The returned function accepts no arguments and pushes a Lua table where header names are keys and values are lists.
func GetAllHTTPRequestHeadersWithMeta ¶ added in v1.11.0
func GetAllHTTPRequestHeadersWithMeta(meta HTTPRequestMeta) lua.LGFunction
GetAllHTTPRequestHeadersWithMeta is a factory alias that returns the same function as GetAllHTTPRequestHeaders(meta).
func GetHTTPMethod ¶ added in v1.5.2
func GetHTTPMethod(meta HTTPRequestMeta) lua.LGFunction
GetHTTPMethod returns a Lua function that pushes the HTTP request method as a string onto the Lua stack.
func GetHTTPMethodWithMeta ¶ added in v1.11.0
func GetHTTPMethodWithMeta(meta HTTPRequestMeta) lua.LGFunction
GetHTTPMethodWithMeta is a factory alias that returns the same function as GetHTTPMethod(meta).
func GetHTTPPath ¶ added in v1.5.2
func GetHTTPPath(meta HTTPRequestMeta) lua.LGFunction
GetHTTPPath returns a Lua function that pushes the HTTP request URL path onto the Lua stack when invoked.
func GetHTTPPathWithMeta ¶ added in v1.11.0
func GetHTTPPathWithMeta(meta HTTPRequestMeta) lua.LGFunction
GetHTTPPathWithMeta is a factory alias that returns the same function as GetHTTPPath(meta).
func GetHTTPQueryParam ¶ added in v1.5.2
func GetHTTPQueryParam(meta HTTPRequestMeta) lua.LGFunction
GetHTTPQueryParam returns a Lua function to fetch a query parameter from the provided HTTP request.
func GetHTTPQueryParamWithMeta ¶ added in v1.11.0
func GetHTTPQueryParamWithMeta(meta HTTPRequestMeta) lua.LGFunction
GetHTTPQueryParamWithMeta is a factory alias that returns the same function as GetHTTPQueryParam(meta).
func GetHTTPRequestBody ¶ added in v1.2.2
func GetHTTPRequestBody(meta HTTPRequestMeta) lua.LGFunction
GetHTTPRequestBody returns a Lua function that retrieves the body of an HTTP request as a Lua string. The returned function reads the HTTP request body, resets it for potential later use, and pushes it as a string to Lua.
func GetHTTPRequestBodyWithMeta ¶ added in v1.11.0
func GetHTTPRequestBodyWithMeta(meta HTTPRequestMeta) lua.LGFunction
GetHTTPRequestBodyWithMeta is a factory alias that returns the same function as GetHTTPRequestBody(meta).
func GetHTTPRequestHeader ¶ added in v1.1.0
func GetHTTPRequestHeader(meta HTTPRequestMeta) lua.LGFunction
GetHTTPRequestHeader returns a Lua function that retrieves specific HTTP request header values as a Lua table. The function expects one argument: the name of the header to retrieve (case-insensitive). It returns a Lua table containing the header values or an empty table if the header is not present.
func GetHTTPRequestHeaderWithMeta ¶ added in v1.11.0
func GetHTTPRequestHeaderWithMeta(meta HTTPRequestMeta) lua.LGFunction
GetHTTPRequestHeaderWithMeta is a factory alias that returns the same function as GetHTTPRequestHeader(meta).
func HTTPData ¶ added in v1.9.2
func HTTPData(ctx *gin.Context) lua.LGFunction
HTTPData returns a Lua function that maps to Gin's ctx.Data(status, contentType, data) Usage from Lua: nauthilus_http_response.data(status_code, content_type, data)
func HTTPDataWithCtx ¶ added in v1.11.0
func HTTPDataWithCtx(ctx *gin.Context) lua.LGFunction
HTTPDataWithCtx is a factory alias that returns the same function as HTTPData(ctx).
func HTTPHTML ¶ added in v1.9.2
func HTTPHTML(ctx *gin.Context) lua.LGFunction
HTTPHTML returns a Lua function to send HTML content (uses Gin's Data with text/html) Usage from Lua: nauthilus_http_response.html(status_code, html_string)
func HTTPHTMLWithCtx ¶ added in v1.11.0
func HTTPHTMLWithCtx(ctx *gin.Context) lua.LGFunction
HTTPHTMLWithCtx is a factory alias that returns the same function as HTTPHTML(ctx).
func HTTPRedirect ¶ added in v1.9.2
func HTTPRedirect(ctx *gin.Context) lua.LGFunction
HTTPRedirect returns a Lua function that maps to Gin's ctx.Redirect(status, location) Usage from Lua: nauthilus_http_response.redirect(status_code, location)
func HTTPRedirectWithCtx ¶ added in v1.11.0
func HTTPRedirectWithCtx(ctx *gin.Context) lua.LGFunction
HTTPRedirectWithCtx is a factory alias that returns the same function as HTTPRedirect(ctx).
func HTTPString ¶ added in v1.9.2
func HTTPString(ctx *gin.Context) lua.LGFunction
HTTPString returns a Lua function that maps to Gin's ctx.String(status, body) Usage from Lua: nauthilus_http_response.string(status_code, body)
func HTTPStringWithCtx ¶ added in v1.11.0
func HTTPStringWithCtx(ctx *gin.Context) lua.LGFunction
HTTPStringWithCtx is a factory alias that returns the same function as HTTPString(ctx).
func LoaderBackendStateless ¶ added in v1.11.0
func LoaderBackendStateless() lua.LGFunction
LoaderBackendStateless returns an empty, stateless module placeholder for nauthilus_backend. It allows require("nauthilus_backend") to succeed before per-request binding replaces it with a request-aware version via BindModuleIntoReq.
func LoaderContextStateless ¶ added in v1.11.0
func LoaderContextStateless() lua.LGFunction
LoaderContextStateless returns an empty, stateless module table for nauthilus_context. It is intended to be preloaded once per VM (base environment). Per-request bindings will later clone this table and inject bound functions via WithCtx factories.
func LoaderDNSStateless ¶ added in v1.11.0
func LoaderDNSStateless() lua.LGFunction
LoaderDNSStateless returns an empty, stateless module placeholder for nauthilus_dns. It allows require("nauthilus_dns") to succeed before per-request binding replaces it with a context-aware version via BindModuleIntoReq.
func LoaderHTTPRequestStateless ¶ added in v1.11.0
func LoaderHTTPRequestStateless() lua.LGFunction
LoaderHTTPRequestStateless returns an empty, stateless module table for nauthilus_http_request. It is intended to be preloaded once per VM (base environment). Per-request bindings will later clone this table and inject bound functions via WithMeta factories.
func LoaderHTTPResponseStateless ¶ added in v1.11.0
func LoaderHTTPResponseStateless() lua.LGFunction
LoaderHTTPResponseStateless returns an empty, stateless module table for nauthilus_http_response. It is intended to be preloaded once per VM (base environment). Per-request bindings will later clone this table and inject bound functions via WithCtx factories.
func LoaderLDAPStateless ¶ added in v1.11.0
func LoaderLDAPStateless() lua.LGFunction
LoaderLDAPStateless returns an empty, stateless module placeholder for nauthilus_ldap. It allows require("nauthilus_ldap") to succeed before per-request binding replaces it with a context-aware version via BindModuleIntoReq.
func LoaderModCache ¶ added in v1.9.0
LoaderModCache registers the nauthilus_cache module into a Lua state. The module exposes cache_set/get/delete/exists/update/keys/size/flush/push/pop_all. The cache is process-wide (no per-request state needed). Usage: L.PreloadModule(definitions.LuaModCache, lualib.LoaderModCache)
func LoaderModContext ¶ added in v1.2.2
func LoaderModContext(ctx *Context) lua.LGFunction
func LoaderModDNS ¶ added in v1.6.5
func LoaderModDNS(ctx context.Context) lua.LGFunction
LoaderModDNS initializes and loads the DNS module for Lua, providing functions for DNS lookups and managing records.
func LoaderModHTTP ¶ added in v1.10.0
func LoaderModHTTP(meta HTTPRequestMeta) lua.LGFunction
LoaderModHTTP loads Lua functions based on an HTTPRequestMeta provider.
func LoaderModHTTPResponse ¶ added in v1.8.5
func LoaderModHTTPResponse(ctx *gin.Context) lua.LGFunction
LoaderModHTTPResponse loads Lua functions to interact with the HTTP response using gin.Context.
func LoaderModMail ¶ added in v1.2.1
LoaderModMail is a stateless module loader for nauthilus_mail. It pre-binds a real SMTP client implementation and exposes send_mail() to Lua. This module does not require request context and can be preloaded once per VM.
func LoaderModMisc ¶ added in v1.2.1
LoaderModMisc registers the miscellaneous module in the Lua state and returns the module table.
func LoaderModOTEL ¶ added in v1.11.5
func LoaderModOTEL(ctx context.Context) lua.LGFunction
LoaderModOTEL provides a context-aware OpenTelemetry Lua module. It binds helper functions and userdata to create and manage spans from Lua.
func LoaderModPassword ¶ added in v1.2.1
LoaderModPassword registers the password-related functions in the Lua runtime and returns the module.
func LoaderModSoftWhitelist ¶ added in v1.4.0
LoaderModSoftWhitelist registers and exposes the soft whitelist module functions to the provided Lua state.
func LoaderOTELStateless ¶ added in v1.11.5
func LoaderOTELStateless() lua.LGFunction
LoaderOTELStateless returns an empty module so require("nauthilus_opentelemetry") never fails.
func MergeStatusAndLogs ¶ added in v1.9.0
func MergeStatusAndLogs(statusSet *bool, reqLogs **CustomLogKeyValue, reqStatus **string, scriptStatus *string, scriptLogs CustomLogKeyValue)
MergeStatusAndLogs merges a single script's status message and logs into the request-level fields. - statusSet controls that only the first non-nil status message is applied. - reqLogs points to the request's aggregated log slice; it will be initialized if nil. - reqStatus is the address of the request's status message pointer. - scriptStatus is the per-script status message pointer (may be nil). - scriptLogs is the per-script collected logs.
func PackagePath ¶
PackagePath ensures Lua package.path contains our required paths exactly once, without unbounded growth.
func PutCommonRequest ¶ added in v1.7.2
func PutCommonRequest(cr *CommonRequest)
PutCommonRequest returns a CommonRequest to the pool after resetting it.
func RegisterBackendResultType ¶ added in v1.2.2
RegisterBackendResultType registers a new Lua type `nauthilus_backend_result` and attaches provided methods to its metatable.
func RemoveHTTPResponseHeader ¶ added in v1.8.5
func RemoveHTTPResponseHeader(ctx *gin.Context) lua.LGFunction
RemoveHTTPResponseHeader returns a Lua function that removes an HTTP response header Usage from Lua: nauthilus_http_response.remove_http_response_header(name)
func RemoveHTTPResponseHeaderWithCtx ¶ added in v1.11.0
func RemoveHTTPResponseHeaderWithCtx(ctx *gin.Context) lua.LGFunction
RemoveHTTPResponseHeaderWithCtx is a factory alias that returns the same function as RemoveHTTPResponseHeader(ctx).
func Resolve ¶ added in v1.6.5
func Resolve(ctx context.Context) lua.LGFunction
Resolve performs a DNS record lookup for the specified domain and record type using Lua and the provided context. It supports record types such as A, AAAA, MX, NS, TXT, CNAME, and PTR and returns the result or an error to Lua.
func SendMail ¶ added in v1.1.0
func SendMail(smtpClient smtp.Client) lua.LGFunction
SendMail sends an email using the provided smtp.Client and Lua table parameters for configuration and recipient data. It extracts settings like server, port, credentials, and email content from the Lua table and invokes the SMTP client.
func SetHTTPContentType ¶ added in v1.9.2
func SetHTTPContentType(ctx *gin.Context) lua.LGFunction
SetHTTPContentType returns a Lua function that sets the Content-Type header explicitly Usage from Lua: nauthilus_http_response.set_http_content_type(value)
func SetHTTPContentTypeWithCtx ¶ added in v1.11.0
func SetHTTPContentTypeWithCtx(ctx *gin.Context) lua.LGFunction
SetHTTPContentTypeWithCtx is a factory alias that returns the same function as SetHTTPContentType(ctx).
func SetHTTPResponseHeader ¶ added in v1.8.5
func SetHTTPResponseHeader(ctx *gin.Context) lua.LGFunction
SetHTTPResponseHeader returns a Lua function that sets (overwrites) an HTTP response header Usage from Lua: nauthilus_http_response.set_http_response_header(name, value)
func SetHTTPResponseHeaderWithCtx ¶ added in v1.11.0
func SetHTTPResponseHeaderWithCtx(ctx *gin.Context) lua.LGFunction
SetHTTPResponseHeaderWithCtx is a factory alias that returns the same function as SetHTTPResponseHeader(ctx).
func SetHTTPStatus ¶ added in v1.8.6
func SetHTTPStatus(ctx *gin.Context) lua.LGFunction
SetHTTPStatus returns a Lua function that sets the HTTP status code for the response Usage from Lua: nauthilus_http_response.set_http_status(code)
func SetHTTPStatusWithCtx ¶ added in v1.11.0
func SetHTTPStatusWithCtx(ctx *gin.Context) lua.LGFunction
SetHTTPStatusWithCtx is a factory alias that returns the same function as SetHTTPStatus(ctx).
func SetStatusMessage ¶
func SetStatusMessage(status **string) lua.LGFunction
SetStatusMessage sets a new status message by updating the provided string pointer based on the input from the Lua state.
func StopGlobalCache ¶ added in v1.9.0
func StopGlobalCache()
StopGlobalCache is an optional helper to stop the janitor; can be used by shutdown hooks. StopGlobalCache stops the background janitor of the process-wide cache. Call this during server shutdown to release goroutines promptly.
func WriteHTTPResponseBody ¶ added in v1.8.6
func WriteHTTPResponseBody(ctx *gin.Context) lua.LGFunction
WriteHTTPResponseBody returns a Lua function that writes raw data to the HTTP response body Usage from Lua: nauthilus_http_response.write_http_response_body(data) Note: Set appropriate Content-Type header before writing if needed.
func WriteHTTPResponseBodyWithCtx ¶ added in v1.11.0
func WriteHTTPResponseBodyWithCtx(ctx *gin.Context) lua.LGFunction
WriteHTTPResponseBodyWithCtx is a factory alias that returns the same function as WriteHTTPResponseBody(ctx).
Types ¶
type CommonRequest ¶
type CommonRequest struct {
// Debug is a flag indicating if the action is executed in debug mode.
Debug bool
// Repeating is a flag indicating if the action would be repeated.
Repeating bool
// UserFound is a flag indicating if the user executing the action was found in the system.
UserFound bool
// Authenticated is a flag indicating if the user is authenticated.
Authenticated bool
// NoAuth is a flag indicating if the action requires no authentication.
NoAuth bool
// BruteForceCounter keeps track of unsuccessful login attempts for the user.
BruteForceCounter uint
// Service is the http routers endpoint name.
Service string
// Session stores the unique session identifier.
Session string // GUID
// ClientIP stores the IP address of the client.
ClientIP string
// ClientPort stores the port number used by the client.
ClientPort string
// ClientNet stores the network used by the client.
ClientNet string
// ClientHost stores the hostname of the client.
ClientHost string
// ClientID stores the unique identifier for the client.
ClientID string
// UserAgent stores toe User-Agent of the client.
UserAgent string
// LocalIP stores the IP address of the local machine.
LocalIP string
// LocalPort stores the port number used by the local machine.
LocalPort string
// Username stores the username of the user that was used to authenticate.
Username string
// Account stores the user's account information.
Account string
// AccountField stores the user's account field.
AccountField string
// UniqueUserID stores the unique user identifier.
UniqueUserID string
// DisplayName stores the user's display name.
DisplayName string
// Password stores the user's password.
Password string
// Protocol stores the protocol that the user used to authenticate.
Protocol string
// OIDCCID represents the OpenID Connect Client ID used for authentication.
OIDCCID string
// BruteForceName stores the name of the brute force protection mechanism.
BruteForceName string
// FeatureName is a feature that triggered the action.
FeatureName string
// StatusMessage is a configurable message that is returned to the client upon errors (not tempfail).
StatusMessage *string
// XSSL contains SSL information.
XSSL string
// XSSLSessionID is the SSL session identifier.
XSSLSessionID string
// XSSLClientVerify indicates whether SSL client is verified.
XSSLClientVerify string
// XSSLClientDN is the client's Distinguished Name in the SSL certificate.
XSSLClientDN string
// XSSLClientCN is the client's Common Name in the SSL certificate.
XSSLClientCN string
// XSSLIssuer is the issuer of the SSL certificate.
XSSLIssuer string
// XSSLClientNotBefore is the date before which the SSL certificate is not valid.
XSSLClientNotBefore string
// XSSLClientNotAfter is the date after which the SSL certificate is not valid.
XSSLClientNotAfter string
// XSSLSubjectDN is the Subject's Distinguished Name in the SSL certificate.
XSSLSubjectDN string
// XSSLIssuerDN is the Issuer's Distinguished Name in the SSL certificate.
XSSLIssuerDN string
// XSSLClientSubjectDN is the client's Subject Distinguished Name in the SSL certificate.
XSSLClientSubjectDN string
// XSSLClientIssuerDN is the client's Issuer Distinguished Name in the SSL certificate.
XSSLClientIssuerDN string
// XSSLProtocol is the SSL protocol used.
XSSLProtocol string
// XSSLCipher is the encryption cipher used in the SSL protocol.
XSSLCipher string
// SSLSerial is the serial number of the SSL certificate used for secure communication.
SSLSerial string
// SSLFingerprint represents the SSL certificate's fingerprint for the client in the request.
SSLFingerprint string
}
CommonRequest represents a common request object with various properties used in different functionalities.
func GetCommonRequest ¶ added in v1.7.2
func GetCommonRequest() *CommonRequest
GetCommonRequest gets a CommonRequest from the pool or creates a new one if the pool is empty.
func (*CommonRequest) Reset ¶ added in v1.7.2
func (c *CommonRequest) Reset()
Reset resets all fields of the CommonRequest to their zero values.
func (*CommonRequest) SetupRequest ¶
func (c *CommonRequest) SetupRequest(request *lua.LTable) *lua.LTable
SetupRequest sets up the request object with the common request properties
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context is a system-wide Lua context designed to exchange Lua LValues between all Lua levels. Even it implements all methodes from Context, its use is limitted to data exchange. It can not be used to abort running threads. Usage of this context is thread safe.
func (*Context) Get ¶
Get returns the lua.LValue value aquired by key from the Lua Context. If no key was found, it returns nil.
func (*Context) GetExists ¶ added in v1.9.0
GetExists retrieves the value associated with the given key and returns a boolean indicating its existence in the context.
type CustomLogKeyValue ¶
type CustomLogKeyValue []any
func (*CustomLogKeyValue) Set ¶ added in v1.2.6
func (c *CustomLogKeyValue) Set(key string, value any)
Set appends a key-value pair to the CustomLogKeyValue slice. If the receiver pointer c is nil, no action is taken. The key is appended to the slice followed by the value.
type HTTPRequestMeta ¶ added in v1.10.0
type HTTPRequestMeta interface {
Header() http.Header
Method() string
URL() *url.URL
Body() io.ReadCloser
SetBody(io.ReadCloser)
}
HTTPRequestMeta is a thin abstraction over HTTP request data needed by Lua HTTP module. It allows sources other than *http.Request while keeping behavior identical for Lua code.
func NewHTTPMetaFromRequest ¶ added in v1.10.0
func NewHTTPMetaFromRequest(req *http.Request) HTTPRequestMeta
type LuaBackendResult ¶
type LuaBackendResult struct {
// Authenticated represents whether the user is authenticated or not
Authenticated bool
// UserFound indicates whether the user was found in the system or not
UserFound bool
// AccountField is the field associated with the user's account
AccountField string
// TOTPSecretField is the field that holds the user's TOTP Secret
TOTPSecretField string
// TOTPRecoveryField is the field for the user's TOTP recovery code
TOTPRecoveryField string
// UniqueUserIDField is the unique user id field
UniqueUserIDField string
// DisplayNameField is the display name associated with the user's account
DisplayNameField string
// Err captures any error that occurred during the backend process
Err error
// Attributes holds any other attributes related to the user's account
Attributes map[any]any
// Logs is a pointer to a custom log key-value pair associated with the Lua script.
Logs *CustomLogKeyValue
}
LuaBackendResult holds the response returned by the Lua backend. Information about user authentication, user account, and error details are encapsulated in this data structure.
type MailModule ¶ added in v1.3.0
type MailModule struct {
// contains filtered or unexported fields
}
MailModule provides functionalities for sending emails using an SMTP client.
func NewMailModule ¶ added in v1.3.0
func NewMailModule(smtpClient smtp.Client) *MailModule
NewMailModule creates a new MailModule instance with the provided smtp.Client.
func (*MailModule) Loader ¶ added in v1.3.0
func (m *MailModule) Loader(L *lua.LState) int
Loader initializes the MailModule's Lua library by registering its functions and returning the module table. This method pushes the initialized module onto the Lua stack and returns 1 to indicate one value is returned.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package luapool provides a pool for reusing Lua states.
|
Package luapool provides a pool for reusing Lua states. |
|
Package vmpool provides per-key (backend/category) pools of reusable Lua VMs.
|
Package vmpool provides per-key (backend/category) pools of reusable Lua VMs. |