Support one time verification via get endpoints#27
Merged
GrantBirki merged 4 commits intoJun 12, 2025
Conversation
- 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.
Contributor
There was a problem hiding this comment.
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
methodfield with allowed HTTP verbs. - Update the API router to dynamically mount routes using the configured HTTP method (defaulting to POST).
- Implement
OktaSetupHandlerwith acceptance tests and update docs/config examples for the newmethodoption.
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
methodin the table of contents or summary at the top of this document to improve discoverability of the new configuration option.
### `method`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.