Repository navigation
Conversation
…ava (SDK-MFA-ERR-1)
Login against an MFA-enabled account returns 200 {mfa_required, mfa_challenge, totp_available, webauthn_available}; the SDKs read that as a missing token. Now: Go *MFARequiredError + VerifyMFA, Python MFARequiredError + verify_mfa/login(mfa_code=), Node MFARequiredError + verifyMfa/login(..,{mfaCode}), Java MFARequiredException + verifyMfa/login(..,mfaCode). Contract tests enrol a TOTP user on a real server.
Session: SDK-CLIENTS-1
Signed-off-by: Andrei Beshkov <andrey.beshkov@gmail.com>
…, Node, Java
The server reports purge_at only for soft-deleted secrets (recycle-bin listing GET /projects/{id}/secrets/deleted; DELETE /secrets/{id} also sends a Keyorix-Purge-At header). Each SDK gets the field on its secret type plus a list-deleted-secrets method that fills it. Contract tests soft-delete a secret on a real server and assert purgeAt is ~30 days out.
Session: SDK-CLIENTS-1
Signed-off-by: Andrei Beshkov <andrey.beshkov@gmail.com>
…ions Session: SDK-CLIENTS-1 Signed-off-by: Andrei Beshkov <andrey.beshkov@gmail.com>
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.
One PR, one commit per item. All four SDKs (Go, Python, Node, Java). No server change, no
.githubchange. The repo has nochangelog.d, so entries are in each SDK's ownCHANGELOG.md.Item 1 — SDK-MFA-ERR-1: typed MFA error + second step
Server contract (read from
server/http/handlers/auth.goandopenapi.yaml):POST /auth/loginfor an MFA account answers 200{data:{mfa_required:true, mfa_challenge, totp_available, webauthn_available}}(no token), andPOST /auth/mfa/verify {mfa_challenge, code}(TOTP or recovery code) returns the normal login payload. The SDKs treated the 200 as a missing token.*MFARequiredErrorVerifyMFA(ctx, url, challenge, code)MFARequiredErrorverify_mfa(...),login(..., mfa_code=)MFARequiredErrorverifyMfa(...),login(..., { mfaCode })MFARequiredExceptionKeyorix.verifyMfa(...),Keyorix.login(url, user, pass, mfaCode)Each carries the challenge plus
totp_available/webauthn_available. Passkey ceremony is not implemented.Contract tests (real server, fresh SQLite): create a user, enrol TOTP through the API, assert the typed error + challenge, a wrong code gives the auth error, the right code gives a working token.
Red on main (main's SDK source, new contract test):
❌ login() for an MFA-enrolled account rejects with MFARequiredError — got AuthError: No token in login responseAttributeError: module 'keyorix' has no attribute 'MFARequiredError'undefined: MFARequiredError,undefined: VerifyMFA(does not compile)cannot find symbol class MFARequiredException,String cannot be converted to Duration(does not compile)Green with the change:
TestContract_MFALoginPASS; PythonTestContractMFALoginOK; Node 3 MFA assertions ✅; JavaContractTest8/9 (see below).Item 2 —
purgeAt(RETENTION-1)The server only reports
purge_atfor soft-deleted secrets: the recycle-bin listGET /projects/{id}/secrets/deleted(and aKeyorix-Purge-Atheader onDELETE). None of the SDKs could list deleted secrets, so each gets the field on its secret type (PurgeAt *time.Time/purge_at/purgeAt/getPurgeAt()) plusListDeletedSecrets/list_deleted_secrets/listDeletedSecretsto fill it. Live secrets have it empty/nil.Contract tests soft-delete a secret and assert
purgeAtis ~30 days out (retention_days: 30) and empty beforehand. Red on main: field/method missing (s.PurgeAt undefined,AttributeError: 'Secret' object has no attribute 'purge_at',client.listDeletedSecrets is not a function). Green after.Item 3 — COMPATIBILITY.md
MFA/purge rows, minimum server versions (MFA flow v0.4.0,
purgeAtv0.96.0, fromgit tag --contains), and an "Open items" section.Verification and caveats
Run natively on this Mac against a keyorix server built from main (
c753f5444), SQLite,security.require_mfa: false:go test ./...ok,go vetclean,gofmtclean; Python unit suite 44 ok; Nodetest.js47/47.javacand run through the JUnit launcher with the jars from~/.m2. CI'smvnrun is the real check..github/contract-server/keyorix.yamllacksrequire_mfa: false; with the ADR-112 default (on) the bootstrap admin is confined to enrolment (403) and most contract cases fail on current server main. Separately, the machine-token "must be forbidden" case fails in all four SDKs even with it off (a fresh machine identity is no longer forbidden). Both are in COMPATIBILITY.md "Open items"; the first needs a.githubchange for the coordinator.Session: SDK-CLIENTS-1