Repository navigation
feat: PM-KISAN grievance in the Grievance plugin [#60] - #71
Open
KrutikaPhirangi wants to merge 3 commits into
Open
KrutikaPhirangi wants to merge 3 commits into
KrutikaPhirangi wants to merge 3 commits into
Conversation
🛡️ Trivy security scan (CRITICAL,HIGH,MEDIUM,LOW)Go dependenciesNo findings at CRITICAL,HIGH,MEDIUM,LOW. Container imageNo findings at CRITICAL,HIGH,MEDIUM,LOW. |
|
📊 Test Coverage: ✅ Passed — 87% of changed lines covered, min 80% |
KrutikaPhirangi
force-pushed
the
feat/60-pmkisan-grievance
branch
5 times, most recently
from
October 12, 2026 07:11
7b9405d to
c52852f
Compare
KrutikaPhirangi
force-pushed
the
feat/60-pmkisan-grievance
branch
from
October 13, 2026 09:42
4f46f90 to
89a0339
Compare
manjudr
added this pull request to stack #87
October 22, 2026 06:40
KrutikaPhirangi
force-pushed
the
feat/60-pmkisan-grievance
branch
from
October 22, 2026 11:36
b0d918b to
2766899
Compare
KrutikaPhirangi
added a commit
that referenced
this pull request
Oct 22, 2026
- The OTP verify and the follow-up read share one client that refuses an off-host redirect, as common's does, so a 302 cannot re-POST the farmer's identifier to another host. - Envelope settings without envelope: are refused at startup instead of sending the body unsealed. - The verify and the follow-up run on their own budgets, otpVerifyTimeoutMs and followUpTimeoutMs (default 15000), not the action's, so one status no longer spends three of its timeouts. - The GCM comment says what a fixed nonce breaks, and a nonce shorter than 12 bytes is refused.
KrutikaPhirangi
added a commit
that referenced
this pull request
Oct 23, 2026
…s binding [#60] Answers the remaining review on PR #71. The envelope -- AES-GCM and AES-CBC codecs, the challenge verify, the follow-up read -- moves from Grievance to internal/common/envelope. None of it is grievance knowledge, so the next provider with an encrypted upstream uses it without importing a package called Grievance. What a capability does know comes in as Hooks: where its payload carries the challenge, and what its provider's "yes" looks like. Grievance keeps only those (otp.go) and calls envelope.Parse. The OTP service is no longer an env var. otpBindingKey names the binding whose participant serves it (pmkisan-chatbot|openagrinet:SchemeApplication), and its host is read from the registry per call, with the same status checks as any participant, so the address lives in one place. common.Config.HostedElsewhere sends an action to that participant's host; it replaces the Router interface and BaseURLFor, which existed only for this redirect. An unpublished OTP binding is a 502.
Member
|
@KrutikaPhirangi - The PR is too big—Can you split the application status and grievance ? |
KrutikaPhirangi
force-pushed
the
feat/60-pmkisan-grievance
branch
from
October 23, 2026 08:02
799306c to
c35609c
Compare
KrutikaPhirangi
force-pushed
the
feat/60-pmkisan-grievance
branch
from
October 23, 2026 08:08
c35609c to
c349bfd
Compare
KrutikaPhirangi
force-pushed
the
feat/60-pmkisan-grievance
branch
from
October 23, 2026 10:00
c349bfd to
3c43c4b
Compare
…on on another participant [#60] internal/common/envelope seals a mapped request and opens the answer: aesGcm (fixed key and nonce) and aesCbcKeyInBand (fresh key per request), with the service token added after the mapping. It can verify a challenge on the provider before the guarded call, on its own budget, through a client that refuses an off-host redirect. A capability supplies Hooks: where its payload carries the challenge and what its provider's "yes" looks like. common.Config.HostedElsewhere sends an action to the participant behind another binding key, its host read from the registry per call (common.HostOf).
…ue out of the rest [#60] extendedSchema_contextRewrite takes "from|to" prefix pairs: a pack whose published @context does not serve it is fetched from the rewritten URL, while the payload keeps its @context. The allowlist is checked on the rewritten host. Schema errors already carry the reason alone; a non-schema error and the two debug logs that printed the raw error now drop the schema and the offending value too, which a pack can mark no-echo.
PM-KISAN grievance on the Grievance pack: init sends an OTP through the chatbot service's participant (otpBindingKey), support lodges and status reads, each after the OTP is verified there. Bodies are AES-GCM with the service token inside. The mappings only build bodies and read answers; input rules are the pack's. A refusal with a known reason (an unknown registration number) is a 400 BIZ_GENERIC_ERROR naming the field; any other is a 502; no record found is a 400. The provider's text is logged, never returned.
KrutikaPhirangi
force-pushed
the
feat/60-pmkisan-grievance
branch
from
October 23, 2026 10:41
3c43c4b to
0d77809
Compare
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.
What
PM-KISAN grievance in the
Grievanceplugin, beside PMFBY, on the Grievance pack. Application status is split out to its own PR, stacked on this one.init/ChatbotOTPon the chatbot service (AES-128-CBC)pmkisan/grievance.init.yamlsupport/ChatbotOTPVerified, then/LodgeGrievance(AES-GCM)pmkisan/grievance.support.yamlstatus/ChatbotOTPVerified, then/GrievanceStatusCheckpmkisan/grievance.status.yamlCommits
internal/common/envelope): AES-GCM and AES-CBC codecs, OTP verify before the guarded call, capabilityHooks.common.Config.HostedElsewheresends an action to another participant's host, read from the registry. ADR-0001, ADR-0002.extendedSchema_contextRewritefetches the packs from the branch until the published URL serves them; schema errors carry the reason and path, never the value. ADR-0003.Code comments are kept short; the reasoning is in the ADRs, #92.
Config
pmkisanblock inconfig/provider-adapter.yaml. Env vars:PMKISAN_GRIEVANCE_KEY,PMKISAN_GRIEVANCE_IV,PMKISAN_SERVICE_TOKEN,PMKISAN_OTP_TOKEN. The OTP service is thepmkisan-chatbot|openagrinet:SchemeApplicationbinding, so that binding must be active in the registry.Testing
go test ./pkg/plugin/implementation/Grievance/... ./pkg/plugin/implementation/internal/... ./pkg/plugin/implementation/schemav2validator/...