Add comprehensive plan for Gmail OAuth with architect-approved decisions, WebFlux-compatible reactive security, Liquibase-managed database schema, JdbcDatabaseModel for account lookups, and email uniqueness enforcement in crypto trading test app#199
Conversation
…ng app Co-authored-by: jwijgerd <914840+jwijgerd@users.noreply.github.com>
|
@copilot you are going into the right direction, can you add the following:
|
…s, and comprehensive references Co-authored-by: jwijgerd <914840+jwijgerd@users.noreply.github.com>
Updated the plan with all requested changes (commit 3b79c47):
The plan now includes 30+ official reference links from Google, Spring Security, and OAuth/OIDC standards. |
|
@copilot nice additions, I have a couple of more questions and remarks:
|
…a client examples Co-authored-by: jwijgerd <914840+jwijgerd@users.noreply.github.com>
Updated the plan with all requested changes (commit 6bbac91):
Added complete GCP Service Account setup instructions, JWKS configuration for both services, and 15+ new references for GCP, Nimbus, and JWKS/JWT RFCs. |
|
@copilot ok great, now for more security I don't want to deploy the AuthController as part of the commands module but I want you to create a separate module for it. let's call that the auth module. The web layers of the commands and queries module should only validate the JWT. Also, please version the auth urls with v1 We are using terraform to configure the gcp resources (in another repo). can you provide some examples? If there is no terraform support than please explicitely state that. |
…rraform examples Co-authored-by: jwijgerd <914840+jwijgerd@users.noreply.github.com>
Updated the plan with all requested changes (commit 059b62b):
|
|
@copilot you went a bit overboard with the terraform section. Just keep the specific resources needed for the service accounts and key(s) and remove all the rest. I want to use Secret Manager to store the service account key. Add a terraform example for that. Inside the auth module use the Google Cloud Secret Manager API java library to retrieve the secret key data used to sign the JWT. We also use Workload Identity Federation in GKE, add a section on that |
… Workload Identity Federation Co-authored-by: jwijgerd <914840+jwijgerd@users.noreply.github.com>
…e servlet-based filters and security with reactive equivalents Co-authored-by: jwijgerd <914840+jwijgerd@users.noreply.github.com>
| - `spring-security-oauth2-jose` (includes Nimbus JOSE+JWT library) | ||
| - `google-auth-library-oauth2-http` (for GCP Service Account JWT signing) | ||
|
|
||
| 2. **Create GCP Service Account**: |
There was a problem hiding this comment.
The service account is created in another (terraform) repo and should be a given here. Please change to "ensure GCP serivce acccount is created"
There was a problem hiding this comment.
Changed to "Ensure GCP Service Account is Created" in commit 0108b91. The step now assumes the service account has been provisioned via Terraform in the separate infrastructure repository and focuses on verification and noting required configuration details.
…sume GCP Service Account exists Co-authored-by: jwijgerd <914840+jwijgerd@users.noreply.github.com>
Updated (commit 0108b91): Added prominent disclaimer at the start of the Terraform section stating it's for reference only and managed in a separate infrastructure repository. Also updated Phase 1 step from "Create GCP Service Account" to "Ensure GCP Service Account is Created", clarifying that resources should already exist from Terraform provisioning. |
|
|
||
| public Optional<AccountQueryModelState> findByOAuthProvider(String provider, String providerId) { | ||
| // Query local cache maintained by AccountQueryModel | ||
| return accountQueryModel.findByOAuthProvider(provider, providerId); |
There was a problem hiding this comment.
this is not possible using the kafka based QueryModel, this implemenation will have to be based on the JdbcDatabaseModel and then queries like this can be implemented. Please update the plan accordingly
There was a problem hiding this comment.
Updated (commit 0e09f8b):
Replaced Kafka-based QueryModel with JdbcDatabaseModel approach:
AccountDatabaseModelextendsJdbcDatabaseModeland handlesAccountCreatedEventV2events to persist to databaseAccountQueryServiceusesJdbcTemplatefor queries:findByOAuthProvider()andfindByEmail()- Added database schema with accounts table and indexes on email and (oauth_provider, oauth_provider_id)
- Updated CustomOAuth2UserService to use database queries instead of in-memory cache
- Updated Phase 3 implementation steps to include database model setup
- Updated module structure and documentation throughout plan
…kups in Auth service Co-authored-by: jwijgerd <914840+jwijgerd@users.noreply.github.com>
| } | ||
| ``` | ||
|
|
||
| **Database Schema (create in Auth service resources):** |
There was a problem hiding this comment.
Updated to use Liquibase for database schema management (commit 4ecc5a5). Replaced raw SQL with Liquibase changelog format including createTable, addUniqueConstraint, and createIndex tags. Added liquibase-core dependency, datasource configuration, and Liquibase changelog path to Auth service application.yml.
Co-authored-by: jwijgerd <914840+jwijgerd@users.noreply.github.com>
| - No need to manually manage public key distribution | ||
| - Key rotation is handled automatically by Google | ||
|
|
||
| 4. **Configuration (Commands Service - JWT Generation):** |
There was a problem hiding this comment.
This configuration should be in the Auth service
There was a problem hiding this comment.
Updated (commit 751e61d) - Changed configuration section from "Commands Service - JWT Generation" to "Auth Service - JWT Generation", and updated validation section to specify both "Commands and Queries Services - JWT Validation".
…idation in Commands/Queries services Co-authored-by: jwijgerd <914840+jwijgerd@users.noreply.github.com>
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.