-
Notifications
You must be signed in to change notification settings - Fork 16
Add OpenFGC Portal Backend #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
hasithakn
merged 163 commits into
wso2:feature/portal
from
rashmithachamikara:feature/portal-backend
Jul 6, 2026
Merged
Changes from all commits
Commits
Show all changes
163 commits
Select commit
Hold shift + click to select a range
37a538a
Initial commit
rashmithachamikara d136f06
Add .ai-reference to .gitignore for optional symlinks
rashmithachamikara 82ea4c7
Add environment files to .gitignore
rashmithachamikara 82c2384
Update packages to address 1 high severity vulnerability
rashmithachamikara 6b945fc
Migrate to pnpm
rashmithachamikara 63633a0
Configure Linting and Formatting
rashmithachamikara 33cbf05
Configure testing
rashmithachamikara 60fbfcf
Restructure project to match guidlines
rashmithachamikara 02176c5
Update readme with testing section
rashmithachamikara 12f974c
Update gitignore to exclude coverage report directories
rashmithachamikara 7484262
Improve project structure
rashmithachamikara 6253896
Add copilot instructions
rashmithachamikara de45c36
Improve copilot instructions
rashmithachamikara 38d1abc
Add additional copilot instruction files
rashmithachamikara a235ec1
Fix CI script
rashmithachamikara 15265b2
Add localization support with i18next and react-i18next
rashmithachamikara 6d37238
Update readme with project description
rashmithachamikara 5b5438b
Add agents.md instructions to project. Update Readme on agents.md
rashmithachamikara 20a49c6
Install new packages
rashmithachamikara 4a20e1b
Update Vite configuration to include additional inline dependencies
rashmithachamikara 95b7429
Add rule to enforce no extraneous dependencies in ESLint configuration
rashmithachamikara 85087d0
Add router bootstrap and app routes
rashmithachamikara 202b5b7
Add main layout and sidebar components
rashmithachamikara ecc2ae3
Add consent registry page filters and table
rashmithachamikara c934a52
Add dashboard page and consent types
rashmithachamikara 413ef56
Add UI translation strings for layout and consent registry
rashmithachamikara 2b68d63
Add tests for sidebar and consent registry page
rashmithachamikara 0046329
Refactor sx to Box since AppShell.Main doesn’t support sx
rashmithachamikara 670a6d6
Update filter tab styling
rashmithachamikara 83e0c78
Refactor ConsentRegistryFilters layout for improved responsiveness an…
rashmithachamikara c5fcbc3
Remove additional breadcrumb
rashmithachamikara 9f740f4
Update breadcrumb system
rashmithachamikara 7b4eaa7
Remove unused translation entries
rashmithachamikara 1c50c38
Sync consent filters with URL query params
rashmithachamikara 6abe145
Add Pending Consents sidebar route shortcut
rashmithachamikara 4365f21
Add sidebar group for consents
rashmithachamikara 6636b6a
Fix breadcrumbs alignment
rashmithachamikara e986f9a
Move breadcrumbs to page
rashmithachamikara 1395919
Include i18n Internationalization instructions in Agents files
rashmithachamikara f434c36
Format improvements
rashmithachamikara 34adb44
Create consent details page
rashmithachamikara 5103184
Update breadcrumbs for consent details page
rashmithachamikara cf83680
Reduce icon size
rashmithachamikara 5f8440c
Minor spacing improvement
rashmithachamikara 201f44f
Link consent details button to consent registry
rashmithachamikara 3c97de6
Minor UI improvements
rashmithachamikara 7c906fd
Minor UI improvements
rashmithachamikara d5d7661
Minor UI improvements
rashmithachamikara 960c92d
Minor UI improvements
rashmithachamikara 512adae
Minor UI improvements
rashmithachamikara 5e7c6bd
Import openfgc-portal into portal/frontend with full history
rashmithachamikara 736a506
Squashed commit of the following:
rashmithachamikara 2f7f38a
add bff backend scaffold
rashmithachamikara afc71de
add backend tooling and documentation
rashmithachamikara 6153d39
add backend ci workflow
rashmithachamikara 4ef2ff9
Move copilot instructions to monorepo root
rashmithachamikara 67daaef
Refine BFF endpoint structure plan
rashmithachamikara 298373f
Refine BFF endpoint structure plan
rashmithachamikara 0f42d75
Add BFF proxy routes and forwarding service
rashmithachamikara 6b84934
Add proxy and configuration test coverage
rashmithachamikara 006d0d2
Update BFF contract and developer run configuration
rashmithachamikara afb1817
Rename test
rashmithachamikara c6e6141
portal-backend: add configurable credentialed CORS
rashmithachamikara 8e5ea8f
portal-frontend: add fetch and react-query data layer
rashmithachamikara 5a5e7a7
portal-frontend: wire consent screens to BFF
rashmithachamikara 8606ed5
Add mock lifecycle section back
rashmithachamikara 7310024
Update Agents.md with test file naming convention
rashmithachamikara 9796abf
Add modals
rashmithachamikara dcc66eb
Integrate modals into pages
rashmithachamikara a330ee8
Add test for modals
rashmithachamikara 5f118a8
Implement consent aggregation and metadata enrichment for consent ret…
rashmithachamikara a4751ce
Implement consent approval flow with optional selections and update r…
rashmithachamikara 8ad79b1
Remove literal file named BFF_CONFIG_FILE from gitignore
rashmithachamikara cdb9135
Fix: Calling os.Exit(1) inside the goroutine
rashmithachamikara 53273f6
Fix: Run the runtime container as a non-root user.
rashmithachamikara cc54e9a
Fix: Update docker-compose to load local environment overrides from .…
rashmithachamikara 1274af2
Add unit tests for the logger package
rashmithachamikara aa8dc44
Fix: Enhance correlation ID validation and add unit tests for middleware
rashmithachamikara 0fbe95f
Fix: Update golangci-lint versioning in Taskfile to use variable for …
rashmithachamikara f71319c
Move CI workflows for portal backend and frontend to correct director…
rashmithachamikara b74e472
Fix: Rename CI job identifiers for portal backend and frontend workfl…
rashmithachamikara 405df98
Fix: Update workflow paths in portal backend CI configuration
rashmithachamikara 9baeb49
Fix: Add an explicit error-path test for failed consent fetch
rashmithachamikara 17eb446
Fix: Add a fallback-path assertion for i18n behavior
rashmithachamikara 4a2e1e9
Fix: Use neutral root-container styles for app-shell layouts.
rashmithachamikara 013d7ff
Fix: Edge case: epochInSeconds=0 returns '-' instead of valid date.
rashmithachamikara fb7dc71
Test: Add unit tests for date formatting utilities
rashmithachamikara 67944d1
Fix: Externalize brand title string to i18n resources
rashmithachamikara 4718efd
Add WSO2 logo to the header with updated dimensions and styling
rashmithachamikara bf74e00
Add favicon support with multiple sizes and web manifest
rashmithachamikara 0750270
Fix: Date parsing doesn't handle invalid input gracefully.
rashmithachamikara 224db29
Fix: Type assertion undefined as T may cause runtime issues.
rashmithachamikara 00dc33d
Fix: Update version number from 0.0.0 to 0.0.1 in package.json
rashmithachamikara 176510b
Refactor UserID derivation into middleware for placeholder-based user…
rashmithachamikara 4c8ebba
Fix: Inconsistent error handling for response body read failure.
rashmithachamikara 35b258e
Fix: Add type definition for value property
rashmithachamikara 0b8fab3
Fix: Fragile query parameter ordering assertion. Update expected erro…
rashmithachamikara bf0873b
Fix: Empty state message renders alongside the table when rows are empty
rashmithachamikara 49cc71a
Fix: Potential nil-map panic when request body is JSON null
rashmithachamikara 3d31910
Fix: Switch aria-label is not unique per toggle
rashmithachamikara a7ffca8
Refactor: Introduce getConsentStatusChipColor utility for consistent …
rashmithachamikara 0bc7bd2
Refactor status color mapping logic and improve text labels for statuses
rashmithachamikara b24490f
Fix: Add missing REJECTED status
rashmithachamikara fda738b
Fix: Avoid collapsing all fallback requests into one correlation ID
rashmithachamikara 322e7e8
Fix: Typos and Clarity
rashmithachamikara e51b711
Test: Add unit tests for MainLayout component
rashmithachamikara 181b15e
Fix: Avoid duplicate brand announcement for screen readers.
rashmithachamikara 3b49aa7
Fix: Externalize hardcoded user-facing strings to i18n resources
rashmithachamikara 5088ea9
Remove unnencessary comments from authroizations
rashmithachamikara 423db16
Add authorization modal
rashmithachamikara 663bb00
Update mock timestamps in ConsentDetailsPage.tsx lifecycle table to i…
rashmithachamikara 7832ab9
Fix: Update revocation messages for clarity and consistency
rashmithachamikara 974716c
Add tooltip for button when no resources are available in ConsentDeta…
rashmithachamikara 85d4eae
Fix: Update test for revocation modal
rashmithachamikara 6d55ab5
Fix: Adjust CI workflow triggers for pull requests and pushes
rashmithachamikara f57f75f
Fix: Fixed unused-parameter issue by linter
rashmithachamikara 85e4f23
Update consent table. Remove consent id and created date column. Make…
rashmithachamikara dde4d72
Improve consent purpose display
rashmithachamikara a7dc3c7
Improve consent purpose popover
rashmithachamikara d6e0609
Refactor consent status handling and improve status normalization fun…
rashmithachamikara a85b4b5
Improve consent elements table layout and truncate element names for …
rashmithachamikara 556fde5
Refactor column widths in ConsentRegistryTable for improved layout co…
rashmithachamikara b4816ba
Enhance ConsentDetailsPage with additional formatting, omitting and t…
rashmithachamikara 20294c6
Update title
rashmithachamikara 8bfb208
Fix: Validate the upstream URL before constructing the service.
rashmithachamikara e5a964b
Fix: Skip Content-Length in header copying; remove manual header blan…
rashmithachamikara 1ec7ae9
Fix: Handle headers listed in the Connection header when forwarding r…
rashmithachamikara 264a702
Fix: Specify the language for the project-structure fence.
rashmithachamikara 9e2c774
Fix: Inconsistent handling of validityTime === 0 vs the registry table.
rashmithachamikara 10f8510
Fix: Normalize HeadersInit before merging default headers.
rashmithachamikara 69519ba
Remove unused images
rashmithachamikara 126a76b
Improve portal/backend pord script to add .exe extenion on windows
rashmithachamikara 1fcb82b
Remove AGENTS.md files and copilot instructions files
rashmithachamikara 8dbcb57
Add license headers
rashmithachamikara 4ca4246
Several UI enhancements
rashmithachamikara c3b2d31
Add skeletons for loading
rashmithachamikara 33541a4
Reduce consent details cache TTL
rashmithachamikara f941da5
Add tooltips for table action buttons. Minor UI enhancements
rashmithachamikara d1bfbdb
Fix: Navigation to pending consent page keeps the current page of all…
rashmithachamikara e6b397f
Enhance header handling: Add TE header to canonical set and update te…
rashmithachamikara b300a06
Refactor: Unify header handling in writeUpstreamResponse and add test…
rashmithachamikara b83abbb
Fix: Pin golangci-lint version to v1.64.8 for consistency in CI
rashmithachamikara 926c964
Fix: Enhance API method handling to return 404 for unknown paths with…
rashmithachamikara e2606b2
Add .env.example and update configuration to require VITE_API_BASE_URL
rashmithachamikara 3f52cb9
Fix: Add VITE_API_BASE_URL environment variable to portal frontend CI…
rashmithachamikara 159187c
Add phased implementation plan for BFF architecture
rashmithachamikara e89c220
Remove frontend changes from backend PR
rashmithachamikara 9b4f183
Fix: Add an explicit non-root USER in the runtime stage
rashmithachamikara 2fc2496
Apply multiple fixes
rashmithachamikara 497753a
Merge branch 'feature/portal-backend' of https://github.com/rashmitha…
rashmithachamikara b4e49ba
Remove frontend changes from backend PR
rashmithachamikara 4a16a9c
Fix: Copilot suggested fixes
rashmithachamikara 1342587
Fix: Copilot suggested fixes
rashmithachamikara 4bb59f5
Fix: Copilot suggested fixes
rashmithachamikara b1a788b
Add proxy URL path joining logic and add test for base path preservation
rashmithachamikara 730c8c2
Fix: Validation rejects all placeholder trusted-header values when pl…
rashmithachamikara c5e8aaf
Fix: Copilot suggested fixes
rashmithachamikara a8efad3
Fix: Buffered upstream responses now have a configurable max size
rashmithachamikara a0f04e7
Fix: Copilot suggested fixes
rashmithachamikara fbe1d39
Fix multiple issues
rashmithachamikara 88a73c1
Add UUID validation for `consentId`
rashmithachamikara 67c2789
Refactor to match the consent-server
rashmithachamikara 051dc0f
Refactor tests
rashmithachamikara File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| name: Portal Backend CI | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - 'portal/backend/**' | ||
| - '.github/workflows/portal-backend-ci.yml' | ||
| push: | ||
| branches: [ main ] | ||
| paths: | ||
| - 'portal/backend/**' | ||
| - '.github/workflows/portal-backend-ci.yml' | ||
|
|
||
| jobs: | ||
| portal-backend-ci: | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| working-directory: portal/backend | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version-file: portal/backend/go.mod | ||
|
|
||
| - name: Download deps | ||
| run: go mod download | ||
|
|
||
| - name: Format check | ||
| run: | | ||
| test -z "$(gofmt -l . | tee /dev/stderr)" | ||
|
|
||
| - name: golangci-lint | ||
| uses: golangci/golangci-lint-action@v9 | ||
| with: | ||
| working-directory: portal/backend | ||
| version: v2.12.2 | ||
|
|
||
| - name: Run tests | ||
| run: go test ./... -v | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # Optional config file path. If unset, defaults are used and env overrides apply. | ||
| BFF_CONFIG_FILE= | ||
|
|
||
| # Server | ||
| BFF_SERVER__HOST=0.0.0.0 | ||
| BFF_SERVER__PORT=8080 | ||
| BFF_SERVER__READ_TIMEOUT=15s | ||
| BFF_SERVER__WRITE_TIMEOUT=15s | ||
| BFF_SERVER__IDLE_TIMEOUT=60s | ||
| BFF_SERVER__SHUTDOWN_TIMEOUT=10s | ||
|
|
||
| # Logging | ||
| BFF_LOG__LEVEL=info | ||
|
|
||
| # Environment | ||
| BFF_ENV=development | ||
|
|
||
| # CORS (frontend integration) | ||
| BFF_CORS__ALLOWED_ORIGINS=http://localhost:3000,http://localhost:5173 | ||
| BFF_CORS__ALLOWED_METHODS=GET,POST,PUT,DELETE,OPTIONS | ||
| BFF_CORS__ALLOWED_HEADERS=Content-Type,X-Correlation-ID | ||
| BFF_CORS__ALLOW_CREDENTIALS=false | ||
|
|
||
| # Proxy | ||
| BFF_PROXY__OPENFGC_API_URL=http://localhost:9090 | ||
| BFF_PROXY__OPENFGC_API_TIMEOUT=10s | ||
| BFF_PROXY__MAX_REQUEST_BYTES=1048576 | ||
| BFF_PROXY__MAX_RESPONSE_BYTES=10485760 | ||
| BFF_PROXY__ALLOWED_PASSTHROUGH_METHODS=["GET","POST","PUT","DELETE"] | ||
|
|
||
| # Placeholder identity mode (Phase 2 only; must be false in production) | ||
| BFF_PROXY__PLACEHOLDER_MODE_ENABLED=false | ||
| BFF_PROXY__PLACEHOLDER_USER_ID= | ||
| BFF_PROXY__PLACEHOLDER_ORG_ID= | ||
| BFF_PROXY__PLACEHOLDER_CLIENT_ID= |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # Go build outputs | ||
| bin/ | ||
| *.exe | ||
| *.dll | ||
| *.so | ||
| *.dylib | ||
| *.test | ||
| *.out | ||
|
|
||
| # Coverage outputs | ||
| coverage.out | ||
| coverage.txt | ||
| *.cov | ||
|
|
||
| # Local environment/config files | ||
| .env | ||
| .env.local | ||
| local.yaml | ||
| local.yml | ||
|
|
||
| # IDE/editor files | ||
| .vscode/ | ||
| .idea/ | ||
| *.swp | ||
|
|
||
| # OS files | ||
| .DS_Store | ||
| Thumbs.db |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| version: "2" | ||
|
|
||
| run: | ||
| timeout: 3m | ||
| tests: true | ||
|
|
||
| linters: | ||
| enable: | ||
| - govet | ||
| - staticcheck | ||
| - revive | ||
|
|
||
| formatters: | ||
| enable: | ||
| - gofmt |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| FROM golang:1.26.3 AS builder | ||
| WORKDIR /app | ||
| COPY . . | ||
| RUN go mod download && go build -o /out/bff ./cmd/server | ||
|
|
||
| FROM gcr.io/distroless/base-debian12:nonroot | ||
| WORKDIR /app | ||
| COPY --from=builder /out/bff /app/bff | ||
| USER 65532:65532 | ||
| EXPOSE 8080 | ||
| ENTRYPOINT ["/app/bff"] | ||
|
rashmithachamikara marked this conversation as resolved.
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| <!-- | ||
| * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com). | ||
| * | ||
| * WSO2 LLC. licenses this file to you under the Apache License, | ||
| * Version 2.0 (the "License"); you may not use this file except | ||
| * in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| --> | ||
|
|
||
| # OpenFGC Portal Backend (BFF) | ||
|
|
||
| Stateless backend-for-frontend (BFF) for OpenFGC Portal, responsible for handling portal-facing authentication flows and securely proxying API requests from `portal/frontend` to `/consent-server`. | ||
|
rashmithachamikara marked this conversation as resolved.
|
||
|
|
||
| ## Commands | ||
|
|
||
| - `task fmt` | ||
| - `task fmt:check` (no edits. check only) | ||
| - `task lint` | ||
| - `task lint:install` (optional, installs golangci-lint to GOPATH/bin) | ||
| - `task test` | ||
| - `task build` | ||
| - `task run` | ||
| - `task run:env` (loads variables from `.env` for local development) | ||
|
|
||
| Install Task if needed: https://taskfile.dev/installation/ | ||
|
|
||
| ## Configuration | ||
|
|
||
| - Primary source: `BFF_` environment variables | ||
| - Optional file overlay: set `BFF_CONFIG_FILE` to a YAML config file path | ||
| - Final effective config is: defaults < file < env | ||
|
|
||
| ### CORS for local frontend | ||
|
|
||
| When running `portal/frontend` on a different origin (for example Vite dev server), allow that origin with: | ||
|
|
||
| - `BFF_CORS__ALLOWED_ORIGINS` (comma-separated origins) | ||
| - `BFF_CORS__ALLOWED_METHODS` (comma-separated methods) | ||
| - `BFF_CORS__ALLOWED_HEADERS` (comma-separated request headers) | ||
| - `BFF_CORS__ALLOW_CREDENTIALS` (`true`/`false`) | ||
|
|
||
| Requests that include an `Origin` header from a non-allowlisted origin are rejected. | ||
| When credentials are enabled, origins must be explicitly allowlisted (wildcard origin is rejected). | ||
|
|
||
| ## Health endpoints | ||
|
|
||
| - `GET /health` | ||
| - `GET /health/liveness` | ||
| - `GET /health/readiness` | ||
|
|
||
| ## API endpoints | ||
|
|
||
| Portal-facing user endpoints: | ||
|
|
||
| - `GET /me/consents` -> upstream `GET /api/v1/consents` with forced `userIds=<placeholder>` | ||
| - `GET /me/consents/{consentId}` -> upstream `GET /api/v1/consents/{consentId}` | ||
| - `POST /me/consents/{consentId}/approve` -> BFF fetches current consent, merges selected optional approvals, uses the consent's `clientId` as the trusted upstream `TPP-client-id`, updates an existing authorization to approved for the trusted user (or creates one if none exist), and upstreams `PUT /api/v1/consents/{consentId}` | ||
| - `PUT /me/consents/{consentId}/revoke` -> upstream `PUT /api/v1/consents/{consentId}/revoke` | ||
|
|
||
| Proxy hardening: | ||
|
|
||
| - Path rewrite `/api/*` -> `/api/v1/*` with query preservation | ||
| - Deny-by-default allowlist for consent-server routes (unknown path -> `404`, known path wrong method -> `405`) | ||
| - Hop-by-hop header stripping and trusted-header override prevention (`org-id`, `TPP-client-id`) | ||
| - Correlation ID propagation/generation via `X-Correlation-ID` | ||
| - Request body limit enforcement (`BFF_PROXY__MAX_REQUEST_BYTES`) with `413` | ||
| - Deterministic upstream error mapping: timeout -> `504`, other connectivity failures -> `502` | ||
|
|
||
| Error contract for proxy-originated failures: | ||
|
|
||
| ```json | ||
| { | ||
| "code": "REQUEST_TOO_LARGE", | ||
| "message": "request entity too large" | ||
| } | ||
| ``` | ||
|
|
||
| Common error codes: | ||
|
|
||
| - `REQUEST_TOO_LARGE` | ||
| - `METHOD_NOT_ALLOWED` | ||
| - `NOT_FOUND` | ||
| - `INVALID_PAYLOAD` | ||
| - `UPSTREAM_TIMEOUT` | ||
| - `UPSTREAM_UNAVAILABLE` | ||
|
|
||
| ## Placeholder mode guardrails | ||
|
|
||
| - `BFF_PROXY__PLACEHOLDER_MODE_ENABLED=true` is blocked when `BFF_ENV=production` | ||
| - `BFF_PROXY__PLACEHOLDER_USER_ID` must be empty if placeholder mode is disabled | ||
|
|
||
| ## AI Instructions | ||
|
|
||
| This repository uses VS Code Copilot instruction files to keep AI-generated changes aligned with project and organization standards. | ||
|
|
||
| - Backend standards: `portal/backend/AGENTS.md` | ||
| - Copilot workspace entrypoint (repo root): `.github/copilot-instructions.md` | ||
| - Scoped instructions folder (repo root): `.github/instructions/` | ||
| - Backend scope mapping: `portal/backend/**` -> `.github/instructions/portal-backend.instructions.md` | ||
|
|
||
| Copilot instructions are discovered automatically and scoped using `applyTo` patterns. | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| version: '3' | ||
|
|
||
| vars: | ||
| GOLANGCI_LINT_VERSION: v2.12.2 | ||
|
|
||
| tasks: | ||
| fmt: | ||
| desc: Format Go source files | ||
| cmds: | ||
| - gofmt -w cmd internal tests | ||
|
|
||
| fmt:check: | ||
| desc: Check formatting without modifying files | ||
| cmds: | ||
| - gofmt -l cmd internal tests | ||
|
rashmithachamikara marked this conversation as resolved.
|
||
|
|
||
| lint: | ||
| desc: Run golangci-lint (no global install required) | ||
| cmds: | ||
| - go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@{{.GOLANGCI_LINT_VERSION}} run ./... | ||
|
|
||
| lint:install: | ||
| desc: Install golangci-lint to GOPATH/bin (optional) | ||
| cmds: | ||
| - go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@{{.GOLANGCI_LINT_VERSION}} | ||
|
|
||
| test: | ||
| desc: Run all tests | ||
| cmds: | ||
| - go test ./... -v | ||
|
|
||
| build: | ||
| desc: Build the BFF binary | ||
| cmds: | ||
| - go build -o bin/portal-backend{{if eq OS "windows"}}.exe{{end}} ./cmd/server | ||
|
|
||
| run: | ||
| desc: Run the BFF server | ||
| cmds: | ||
| - go run ./cmd/server | ||
|
|
||
| run:env: | ||
| desc: Run the BFF server with variables loaded from .env | ||
| dotenv: | ||
| - .env | ||
| cmds: | ||
| - go run ./cmd/server | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.