Migrate Cloud Functions calls to v2 HTTP endpoints (Python backend)#121
Merged
Conversation
Backend Cloud Functions are migrating from NodeJS Gen1 Callable to Python Gen2 HTTP (project rcq-functions-v2). This commit refactors the Angular client to call the new endpoints.
- Rewrite CloudFunctionService on top of HttpClient (9 methods, kebab-case URLs).
- Add AuthTokenInterceptor that injects the Firebase ID token as 'Authorization: Bearer <token>' on every Cloud Function request.
- Register the interceptor via HTTP_INTERCEPTORS in AppModule and drop AngularFireFunctionsModule + REGION provider from runtime code.
- Update environment.sample.ts with v2 base URL (https://europe-west1-rq-fr-{env}.cloudfunctions.net/) and kebab-case endpoint names.
- Refactor service spec to use HttpClientTestingModule and add a dedicated spec for the interceptor.
The spec was failing to compile due to outdated imports and an unconfigured TestBed. Replace it with a minimal smoke test stub so the Karma suite is green again; the file is otherwise unrelated to the Cloud Functions migration.
- docs/cloud-functions-endpoints.md: v2 HTTP API contracts (URL, payload, response) used by the migrated CloudFunctionService, plus migration log. - docs/security-audit-framework.md: generic supply-chain audit methodology (waves). - docs/security-audit-redquest.md: RedQuest-specific implementation plan derived from the framework (npm audit baseline, IoC scan, remediation waves).
Restructure the README around current project layout: prerequisites (Node, Angular CLI, Firebase CLI, gcloud), Google Cloud / Firebase access, environment files location, and dev/build/deploy commands. No functional change.
Replace the hard-coded year list with an array computed from the current year, so 2025/2026/... appear in the dropdown automatically without code change. Ordered descending (most recent first) to match the default selection.
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.
Migrate Cloud Functions calls to v2 HTTP endpoints (Python backend)
Context
The backend Cloud Functions are migrating from NodeJS Gen1 Callable to
Python Gen2 HTTP (project
rcq-functions-v2). This PR refactors theAngular client to:
Callables
Authorization: Bearer ...header through an
HttpInterceptor@angular/fire/functionsdependency fromruntime code
Scope
CloudFunctionServicerewritten on top ofHttpClient(9 methods)AuthTokenInterceptoradded, registered inAppModuleAngularFireFunctionsModuleandREGIONprovider removedv2 base URL (
https://europe-west1-rq-fr-{env}.cloudfunctions.net/)HttpClientTestingModuleOut of scope
rcq-functions-v2)docs/security-audit-redquest.md)Validation (D2 - manual E2E on
rq-fr-dev)ng serve --configuration devcompiles without errorsget-ul-prefs-> 200 OK,Authorization: Bearer eyJ...present,CORS headers OK
tronc-list-prepared-> 200 OK with Bearerbest-effort manual checks, OK on a clean dev account
Tests
ng test --watch=false- Karma suite greenng build --configuration dev- OKRollback plan
project until both
rcq-functions-v2rollout and this client arestable. Reverting the client alone is sufficient to fall back.
Commits
feat(cloud-functions): migrate to HTTP v2 endpoints with Bearer authchore(test): repair pre-existing account.component.specdocs(cloud-functions): API contracts and security audit plandocs(readme): refresh setup instructionsfeat(ranking): dynamic year range 2016 -> current year (descending)Related
rcq-functions-v2docs/cloud-functions-endpoints.mddocs/security-audit-redquest.mdPull Request opened by Augment Code with guidance from the PR author