Skip to content

feat: add metadata field to all hooks#2365

Merged
cstockton merged 1 commit intomasterfrom
cs/hooks-add-metdata
Feb 5, 2026
Merged

feat: add metadata field to all hooks#2365
cstockton merged 1 commit intomasterfrom
cs/hooks-add-metdata

Conversation

@cstockton
Copy link
Contributor

Adds constructors for all hook input types:

  • MFAVerificationAttemptInput
  • PasswordVerificationAttemptInput
  • CustomAccessTokenInput
  • SendSMSInput,
  • SendEmailInput

To consistently populate metadata fields:

  • name - Hook Name
  • uuid - Request UUID
  • time - Request Time
  • ip_address Request IP Address

This improves observability and security auditing by guaranteeing that all hook invocations include request metadata. It also enables new use cases by passing the request IP address. For example more advanced methods for rate limiting login or MFA attempts may now be implemented.

Adds constructors for all hook input types:
* MFAVerificationAttemptInput
* PasswordVerificationAttemptInput
* CustomAccessTokenInput
* SendSMSInput,
* SendEmailInput

To consistently populate metadata fields:
* `name` - Hook Name
* `uuid` - Request UUID
* `time` - Request Time
* `ip_address` Request IP Address

This improves observability and security auditing by guaranteeing
that all hook invocations include request metadata. It also
enables new use cases by passing the request IP address. For
example more advanced methods for rate limiting login or
MFA attempts may now be implemented.
@cstockton cstockton requested a review from a team as a code owner February 5, 2026 16:57
@coveralls
Copy link

Pull Request Test Coverage Report for Build 21720664236

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 74 of 82 (90.24%) changed or added relevant lines in 6 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.06%) to 68.908%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/api/mfa.go 14 22 63.64%
Totals Coverage Status
Change from base Build 21450104510: 0.06%
Covered Lines: 14940
Relevant Lines: 21681

💛 - Coveralls

Copy link
Contributor

@fadymak fadymak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🌟

@cstockton cstockton merged commit c675749 into master Feb 5, 2026
8 of 9 checks passed
@cstockton cstockton deleted the cs/hooks-add-metdata branch February 5, 2026 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants