Repository navigation
Skills: route middleware, registerMiddleware(), group meta and middleware testing - #20
Merged
Merged
Conversation
- routing-development: registerMiddleware() (ColdBox 8.3+), group() meta inheritance (8.3+), and fix the group example that used a middleware name that does not exist - cbsecurity: Route Middleware section (Authenticated, Authorized, JwtAuth, BasicAuth, route meta) and replace the Securing API Routes example, which used a non-existent withMiddleware( "JwtAuthFilter@cbsecurity" ) - testing-integration: execute() and get()/post() run route middleware (8.3+) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E8yy4oK5vnaVucmYLg4UtY
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.
Updates three skills for the route middleware work across ColdBox and cbsecurity.
Changes
coldbox/routing-developmentregisterMiddleware( name, target, point, force )(ColdBox 8.3+: COLDBOX-1460 Add Router.registerMiddleware() for named closure, lambda and instance middleware coldbox-platform#719, COLDBOX-1460), including the bulk form, duplicate andforcerules, and the register-before-reference rule.group()metaoption (8.3+: COLDBOX-1459 Route middleware: run it in BaseTestCase.execute() and let group() share meta coldbox-platform#714).middleware = "cbsecurity", which is not a middleware that exists. It now uses[ "Authenticated@cbsecurity" ].modules/cbsecurityAuthenticated,Authorized,JwtAuthandBasicAuthwithpermissions,rolesandmodein the routemeta()(Add route middleware: auth, Throttle, ApiKey, IP filtering, HTTPS, CSRF, Honeypot and signed URLs coldbox-modules/cbsecurity#74)..withMiddleware( "JwtAuthFilter@cbsecurity" )and.toAction(), neither of which exist. It now usesJwtAuth@cbsecurity.coldbox/testing-integration:execute()andget()/post()run route middleware from ColdBox 8.3, with an example.Version labels follow the existing "ColdBox 8.2.0+" convention. Merge after the linked ColdBox and cbsecurity PRs ship, or keep the 8.3 and 3.9 labels as they are.
Not changed, but wrong
While in
modules/cbsecurity/SKILL.mdI saw other statements that do not match the cbsecurity source. I left them out of this PR to keep it to the middleware work:SecurityService@cbsecurityandgetCurrentUser()(the model isCBSecurity@cbsecurityand the method isgetUser())hasRole(),hasPermission()on the security object (it hashas(),all(),none(),secure()and friends)autoSecureAllandauthenticate, and a booleanwhiteList(the rule keys aresecureList,whitelist,permissions,roles,action, and so on)IUserServicemethod list and thecfauthproviderI can send a follow-up PR that corrects those against the source if wanted.
🤖 Generated with Claude Code
https://claude.ai/code/session_01E8yy4oK5vnaVucmYLg4UtY
Generated by Claude Code