Skip to content

Support one time verification via get endpoints #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 12, 2025

Conversation

GrantBirki
Copy link
Member

No description provided.

- Updated configuration documentation to include the `method` field.
- Modified API to handle dynamic HTTP methods for endpoints.
- Enhanced config validator to accept and validate HTTP methods.
- Added tests for method validation and handling in endpoint configurations.
@Copilot Copilot AI review requested due to automatic review settings June 12, 2025 06:21
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces support for specifying HTTP methods for endpoints (including GET for one-time verification) and adds a dedicated Okta verification handler.

  • Extend the endpoint schema to include an optional method field with allowed HTTP verbs.
  • Update the API router to dynamically mount routes using the configured HTTP method (defaulting to POST).
  • Implement OktaSetupHandler with acceptance tests and update docs/config examples for the new method option.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
lib/hooks/core/config_validator.rb Add optional method to endpoint schema with allowed HTTP verbs.
lib/hooks/app/api.rb Use endpoint_config[:method] to dynamically mount routes via HTTP verb.
spec/unit/lib/hooks/core/config_validator_spec.rb Add unit tests for valid and invalid method values in config validation.
spec/acceptance/plugins/handlers/okta_setup_handler.rb Implement OktaSetupHandler to handle one-time verification GET.
spec/acceptance/config/endpoints/okta_setup.yaml Add example endpoint config for Okta verification via GET.
spec/acceptance/config/endpoints/boomtown.yaml Specify explicit POST method for Boomtown endpoint.
spec/acceptance/acceptance_tests.rb Add acceptance tests for Okta setup GET/POST behavior and error scenarios.
docs/configuration.md Document new method config option, valid values, and default.
Comments suppressed due to low confidence (2)

lib/hooks/app/api.rb:50

  • Consider adding unit tests for Api.create to verify that endpoints are correctly mounted with custom HTTP methods and that the default POST fallback works as expected.
http_method = (endpoint_config[:method] || "post").downcase.to_sym

docs/configuration.md:116

  • [nitpick] Add a corresponding entry for method in the table of contents or summary at the top of this document to improve discoverability of the new configuration option.
### `method`

@GrantBirki GrantBirki merged commit 562d723 into main Jun 12, 2025
22 checks passed
@GrantBirki GrantBirki deleted the support-one-time-verification-via-get-endpoints branch June 12, 2025 06:26
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.

1 participant