Commit Graph

710 Commits

Author SHA1 Message Date
Mayuresh A Nirhali
f774d09711 Merge pull request #640 from beckn/new-context
fix(reqpreprocessor): support camelCase context attributes (bapId, bppId, transactionId, messageId)
2026-03-25 20:27:47 +05:30
Mayuresh
c2e357fd1e reverting changes from schemav2validator plugin 2026-03-25 20:15:51 +05:30
Mayuresh A Nirhali
cc5d347a05 Merge pull request #639 from beckn/camelcase
fix(router): support camelCase context attributes (bppUri, bapUri) fo…
2026-03-25 19:36:08 +05:30
Mayuresh
72593d2ab6 fix(router): support camelCase context attributes (bppUri, bapUri) for beckn spec migration
Replace fixed JSON struct tags for bpp_uri and bap_uri with a map-based parse of
the context object. A new getContextString() helper checks the snake_case key first
and falls back to the camelCase key, so routing works transparently for both the
legacy beckn spec and the new camelCase convention.

Also adds a nil-context guard so a missing context field returns a clear error
instead of a panic.

Test coverage:
- Two new cases in TestRouteSuccess for bppUri and bapUri camelCase payloads
- TestGetContextString: 5 table-driven cases covering snake, camel, precedence,
  missing, and empty-snake-fallthrough scenarios
- TestRouteNilContext: confirms clear error on missing context field

Fixes #636

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 15:41:16 +05:30
Mayuresh
1be757a165 fix(reqpreprocessor): support camelCase context attributes for beckn spec migration
- Add transactionId and messageId as camelCase aliases in model.go contextKeys map,
  pointing to the same ContextKeyTxnID and ContextKeyMsgID constants. This allows
  adapter configs to reference either form without failing startup validation.

- In reqpreprocessor, add firstNonNil() helper for subscriber/caller ID lookups
  so bap_id/bapId and bpp_id/bppId are both resolved correctly regardless of
  which beckn spec version the payload uses. snake_case takes precedence when both
  are present.

- Add snakeToCamel() helper used in the context key loop so a single config entry
  (e.g. transaction_id) automatically also checks the camelCase form (transactionId)
  without requiring any config file changes.

- Add TestSnakeToCamel, TestCamelCaseSubscriberID, TestCamelCaseContextKeys to
  cover all new code paths.

Fixes #637

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 15:40:36 +05:30
Mayuresh A Nirhali
f5825e9e23 Merge pull request #615 from 711ayush711/feat/policyEnforcer
Implement Policy Enforcer Plugin
2026-03-25 15:31:07 +05:30
Ritesh
97e63cf7d2 fix: remove unsupported map fallback in policy result parsing 2026-03-25 14:47:04 +05:30
Ritesh
13a7a18e17 Fix: address policy checker review feedback 2026-03-24 17:59:48 +05:30
711ayush711
1707fb5b02 Merge branch 'beckn:main' into feat/policyEnforcer 2026-03-23 10:21:55 +05:30
Ayush Rawat
80e7b299f1 Refactor Policy Enforcer to Policy Checker
- Renamed the `PolicyEnforcer` interface and related implementations to `PolicyChecker` for clarity and consistency.
- Updated configuration keys in YAML files to reflect the new `checkPolicy` terminology.
- Adjusted related code, tests, and documentation to support the new naming convention and ensure compatibility.
- Enhanced comments and examples for the `checkPolicy` configuration to improve usability.
2026-03-23 04:08:13 +05:30
Mayuresh Nirhali
6d4f45a632 #621 Fixed docker image for onix and tested obs setup 2026-03-12 06:35:14 +00:00
Ayush Rawat
ff4d909b7e Enhance Policy Enforcer Configuration and Add Benchmark Tests
- Added detailed comments and examples for the `policyPaths` configuration in both BAP and BPP YAML files to improve clarity on usage.
- Introduced a new benchmark test suite for the Policy Enforcer to evaluate performance under varying rule counts, measuring both evaluation and compilation times.
2026-03-05 15:31:34 +05:30
Ayush Rawat
dfbaf5c6c5 Refactor Policy Enforcer to Use Unified PolicyPaths
- Updated the Policy Enforcer to consolidate policy source configuration under a single `policyPaths` key, allowing for auto-detection of URLs, directories, and files.
- Removed deprecated keys such as `policyFile` and `policyUrls` from the configuration structure.
- Adjusted related code and tests to ensure compatibility with the new configuration format.
- Enhanced documentation to clarify the usage of `policyPaths` and provide examples for various configurations.
2026-03-03 18:49:17 +05:30
Ayush Rawat
a806af3228 Update Policy Enforcer Configuration Keys
- Changed configuration key from `policyDir` to `policyPaths` across multiple YAML files and related code to standardize the naming convention.
- Updated documentation to reflect the new key name and its usage for specifying local directories containing `.rego` policy files.
- Adjusted tests to ensure compatibility with the updated configuration structure.
2026-03-03 15:02:04 +05:30
Ayush Rawat
e22b79e137 Refactor Policy Enforcer Configuration
- Updated the Policy Enforcer configuration across multiple YAML files to use a unified `policyDir` instead of individual policy sources.
- Changed the step name from `enforcePolicy` to `policyEnforcer` for consistency.
- Enhanced the documentation to clarify the use of `policyUrls`, `policyDir`, and `policyFile` for policy sources.
- Adjusted related code and tests to accommodate the new configuration structure.
- Added documentation for using YAML folded scalar (>-) to keep long comma-separated policyUrls values readable across multiple lines.
2026-03-03 10:04:22 +05:30
Ayush Rawat
3617c9b4a6 Implement Policy Enforcer Plugin
- Added a new Policy Enforcer plugin to evaluate incoming messages against OPA policies.
- Configurable via YAML with options for policy sources, actions, and query.
- Integrated into existing configuration files for BAP and BPP.
- Updated related tests and documentation for the new functionality.
- Enhanced plugin manager to support Policy Enforcer instantiation.
2026-03-02 20:09:33 +05:30
Mayuresh A Nirhali
fe541227b9 Merge pull request #614 from ssd532/fix/test-failures
Fix test failures in reqmapper and simplekeymanager plugins
2026-03-02 17:30:53 +05:30
Mayuresh A Nirhali
01f959a25b Update affiliations from FIDE to Beckn Labs and adding NPCI contributors
Update affiliations from FIDE to Beckn Labs and adding NPCI contributors
2026-02-27 21:59:21 +05:30
Mayuresh A Nirhali
434e0e99d7 Merge pull request #605 from Beckn-One/feat/issues_585
Feat: Network Observability - OTelSetup plugin, Instrumentation in Core.
2026-02-27 21:15:30 +05:30
Manendra Pal Singh
59aa058920 Feat: update the pr as per comment 2026-02-27 19:05:09 +05:30
Manendra Pal Singh
1293c241f7 Fix : update the config 2026-02-26 15:00:28 +05:30
Manendra Pal Singh
80f1cc0f10 Fix : update the config 2026-02-26 14:57:38 +05:30
Manendra Pal Singh
9d57d3b8f1 Feat : Update PR as comment 2026-02-26 14:45:35 +05:30
Sachin Divekar
34954ce83a Fix test failures in reqmapper and simplekeymanager plugins
- reqmapper/cmd: Add missing mappingsFile to TestProviderNewSuccess config
- simplekeymanager/cmd: Fix wantErr for partial config (keyId-only) case
- simplekeymanager/cmd: Use valid base64 key values in TestConfigMapping
- simplekeymanager: Remove incorrect SubscriberID assertion from TestGenerateKeyset
  (GenerateKeyset generates raw keys, subscriber identity is assigned separately)
2026-02-24 20:04:10 +05:30
Manendra Pal Singh
18303eb1b5 Fix : update the matric arrtibute 2026-02-24 13:35:44 +05:30
Manendra Pal Singh
c2f3dbce2c fix: sender and recipient.id 2026-02-23 23:16:49 +05:30
Manendra Pal Singh
ab89102711 Feat: configure audit fields and metrics for onix adapter and add local configuration for onix adapterZ 2026-02-23 16:08:44 +05:30
Mayuresh A Nirhali
9d6004502e Update SETUP.md
#542 - Change the AWS specific link to point to new repo where aws specific tools are maintained.
2026-01-30 20:00:26 +05:30
Mayuresh A Nirhali
b8023e1f6e Merge pull request #606 from nirmalnr/beckn-io-url-update
Update registry URLs in example configuration files to use beckn.io domain
2026-01-30 11:42:52 +05:30
Nirmal N R
0a0e5377ef Update registry URLs in local configuration files to use beckn.io domain 2026-01-30 10:45:25 +05:30
Manendra Pal Singh
2745047b27 Fix : update the name RoleCDS to RoleDiscovery 2026-01-29 23:15:41 +05:30
Manendra Pal Singh
8948479dea Feat: Update the logger config to show the parent_id 2026-01-28 21:29:37 +05:30
Mayuresh A Nirhali
a42159ddb4 Merge pull request #602 from Beckn-One/config-update
Issue 599 - fix reqpreprocessor config: use contextKeys instead of uuidKeys
2026-01-23 13:56:17 +05:30
ameersohel45
9e2a151606 Issue 599 - fix config files 2026-01-23 12:44:53 +05:30
Mayuresh A Nirhali
1db4f60468 Update README.md
add missing 'otelsetup' to list of plugin types
2026-01-21 16:32:06 +05:30
Mayuresh Nirhali
7944a5d147 #598 - Fix service observability doc 2 2026-01-21 16:27:19 +05:30
Mayuresh A Nirhali
445802f4a4 Merge pull request #595 from nirmalnr/feature/allowed_namespaces
feat: add allowed parent namespaces for signature validation
2026-01-21 16:17:33 +05:30
Nirmal N R
c512633cbe chore: updated error message for allowedParentnamespaces validation 2026-01-21 14:57:21 +05:30
Mayuresh Nirhali
0f95a8bb97 #598 - Fix service observability doc 2026-01-21 14:09:06 +05:30
Mayuresh A Nirhali
208102c2d6 Merge pull request #597 from Beckn-One/feat/issues_596
Feat : add automaxprocs to set GOMAXPROCS from cgroup limits
2026-01-21 13:54:11 +05:30
Manendra Pal Singh
d1ca6f260f Feat : add automaxprocs to set GOMAXPROCS from cgroup limits 2026-01-21 13:45:41 +05:30
Nirmal N R
95e5c991a5 feat: add allowed parent namespaces for signature validation 2026-01-20 19:52:45 +05:30
Mayuresh A Nirhali
ce9583279a Merge pull request #590 from Beckn-One/fix/add_tls_support_589
fix : add the tls support for the redis cache
2026-01-13 08:55:38 +05:30
Manendra Pal Singh
f860ff820c add the valdation 2026-01-12 16:44:29 +05:30
Mayuresh A Nirhali
364494a96a Merge pull request #591 from Beckn-One/config-update
Issue 587 - add: include schema-validator2 config for local network s…
2026-01-10 10:43:11 +05:30
ameersohel45
61f1be6e47 Issue 587 - add: include schema-validator2 config for local network setup 2026-01-09 19:10:19 +05:30
Manendra Pal Singh
58457d53c2 fix : add the tls support for the redis cache 2026-01-09 12:40:10 +05:30
Mayuresh A Nirhali
bbc7ff91f9 Merge pull request #568 from Beckn-One/feat/observability
Feat/observability
2025-12-18 15:27:47 +05:30
Manendra Pal Singh
176b8f3043 update the as per the comment 2025-12-18 12:30:28 +05:30
Mayuresh A Nirhali
93cb1647bf Merge pull request #583 from Beckn-One/580-schema2validator
Issue 551 - fix: ensure script exits on plugin build failure
2025-12-15 21:38:58 +05:30