Tutorials: OAuth2#3020
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThree OAuth2 tutorial YAML files and matching integration tests are added, including a token-renewal setup with gateway lifecycle handling. One OAuth2 example test updates its startup wait condition, and one core test file gets a license header. ChangesOAuth2 Tutorial Configs and Tests
OAuth2 example test and core header update
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
distribution/tutorials/security/50-OAuth2-Client-Credentials.yaml (1)
34-37: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRemove the end-user credential store from this client-credentials example.
The tutorial text says this flow is machine-to-machine with no username/password, but Lines 34-37 still provision a user store. Even if the test never uses it, that makes the example teach the wrong contract for
client_credentials.Suggested cleanup
- oauth2authserver: issuer: http://localhost:7007 - staticUserDataProvider: - users: - - username: john - password: password staticClientList: clients: - clientId: abc🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@distribution/tutorials/security/50-OAuth2-Client-Credentials.yaml` around lines 34 - 37, The OAuth2 client-credentials tutorial still provisions an end-user login store via staticUserDataProvider, which conflicts with the machine-to-machine contract. Remove the users/password block from the example YAML so the 50-OAuth2-Client-Credentials tutorial only demonstrates client_credentials setup and no username/password authentication.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@distribution/tutorials/security/55-OAuth2-Client-Token-Renewal.yaml`:
- Around line 22-50: The OAuth2 client renewal tutorial currently never
exercises token expiry, so it only validates initial acquisition. Update the
OAuth2 auth-server setup in the tutorial config so the access token lifetime is
intentionally short, and adjust OAuth2ClientTokenRenewalTutorialTest to send a
second request after the first token has expired. Use the existing
oauth2authserver and oauth2Client flow blocks as the places to change the
renewal scenario, and keep the test asserting that the client re-fetches a new
token on the second request.
---
Nitpick comments:
In `@distribution/tutorials/security/50-OAuth2-Client-Credentials.yaml`:
- Around line 34-37: The OAuth2 client-credentials tutorial still provisions an
end-user login store via staticUserDataProvider, which conflicts with the
machine-to-machine contract. Remove the users/password block from the example
YAML so the 50-OAuth2-Client-Credentials tutorial only demonstrates
client_credentials setup and no username/password authentication.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 36651a06-e4c2-43b6-ad6e-3489dd6aa35b
📒 Files selected for processing (6)
distribution/src/test/java/com/predic8/membrane/tutorials/security/OAuth2ClientCredentialsTutorialTest.javadistribution/src/test/java/com/predic8/membrane/tutorials/security/OAuth2ClientTokenRenewalTutorialTest.javadistribution/src/test/java/com/predic8/membrane/tutorials/security/OAuth2PasswordFlowTutorialTest.javadistribution/tutorials/security/40-OAuth2-Password-Flow.yamldistribution/tutorials/security/50-OAuth2-Client-Credentials.yamldistribution/tutorials/security/55-OAuth2-Client-Token-Renewal.yaml
|
This pull request needs "/ok-to-test" from an authorized committer. |
|
/ok-to-test |
|
|
Summary by CodeRabbit