Skip to content

Commit

Permalink
allow access to client IP and request ID
Browse files Browse the repository at this point in the history
  • Loading branch information
jjuliano committed Feb 8, 2025
1 parent c3fc856 commit 34a6f34
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
14 changes: 14 additions & 0 deletions deps/pkl/APIServerRequest.pkl
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ hidden isValidHTTPMethod = (str) -> if (str.matches(apiMethodRegex)) true else t

/// Represents the request URI path.
path: Uri
/// Represents the Client IP.
IP: String
/// Represents the Request ID.
ID: String
/// The HTTP method used for the request. Must be a valid method, as determined by [isValidHTTPMethod].
method: String(isValidHTTPMethod)
/// The body data of the request, which is optional.
Expand Down Expand Up @@ -145,3 +149,13 @@ function path(): String = path
///
/// [str]: The HTTP method of the request.
function method(): String = method

/// Retrieves the Client IP of the request.
///
/// [str]: The Client IP of the request.
function IP(): String = IP

/// Retrieves the Request ID of the request.
///
/// [str]: The Request ID of the request.
function ID(): String = ID
20 changes: 20 additions & 0 deletions gen/api_server_request/APIServerRequest.pkl.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 34a6f34

Please sign in to comment.