Skip to content

Develop - #91

Open
Nqv1208 wants to merge 46 commits into
mainfrom
develop
Open

Develop#91
Nqv1208 wants to merge 46 commits into
mainfrom
develop

Conversation

@Nqv1208

@Nqv1208 Nqv1208 commented Aug 14, 2026

Copy link
Copy Markdown
Owner

No description provided.

Watermark-based revocation (per-user revoked-before timestamp in Redis)
instead of a per-token blacklist. Login and RefreshToken enforce the
watermark; AccessTokenRevocationEvaluator added with unit coverage.
…paths

Same-transaction synchronous projection (Application port + Infrastructure
implementation) wired into 11 membership write paths: registration, account
and workspace provisioning, invitation acceptance, member add/activate/
suspend/remove/role change, ownership transfer, workspace creation.

- AccessGrant.Activate restores a revoked grant; partial unique account-level
  index ux_access_grants_account_user_account_level added
- InitDb seeds account-level grants alongside workspace grants
- Migration consolidation: single SchemaV2Baseline carrying the strict
  idempotency constraint and the new grant index; incremental migration
  files removed
- Application-level tenant-spoofing proof: TenantBootstrapBehaviorTests
- Integration proof: AccessGrantProjectionTests + RlsRuntimeEnforcementTests
  (runtime grant write enforced under the notrelix_app role)
- Full solution suite: 4251/4251 passing across 7 test projects
@vercel

vercel Bot commented Aug 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
notrelix Ignored Ignored Aug 19, 2026 5:35am

@gitguardian

gitguardian Bot commented Aug 16, 2026

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
36191817 Triggered Generic High Entropy Secret dec54c9 backend/tests/Notrelix.Infrastructure.Tests/Identity/Mfa/MfaTotpServiceTests.cs View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

…h re-authentication

- Step-up policy IA-SEC-002: MFA|password|OAuth proof required for
  DisableMfa, RegenerateRecoveryCodes, OAuth link/unlink
- SecurityStepUpService with single-use proof bound to user+session+purpose
- Session management: list, revoke-by-id, revoke-others; JWT sid claim
- OAuth step-up flow with flow-bound callback dispatch (PeekAsync)
New endpoints: security step-up (requirement/complete-mfa/complete-password),
sessions (list/revoke/revoke-others), OAuth step-up start/callback.
Updated bodies: DisableMfa, RegenerateRecoveryCodes, UnlinkOAuth carry
StepUpToken; StartOAuthLink accepts stepUpToken query.
… from DI

The registration references IResourceAuthorizationSnapshotStore types owned by
a parallel workstream whose files are not yet committed, breaking the build.
Nqv1208 added 18 commits August 17, 2026 13:51
…LK-001..004)

- Add GetDeleteAsync to IRedisCacheService with atomic Lua consume that
  matches Microsoft RedisCache hash entry format (WRONGTYPE fix)
- Rename challenge Redis logical key prefix to identity:mfa:challenge:
- Add ChallengeId to MfaChallengePayload, generated by MfaChallengeFactory (v7)
- Add ChallengeMaxAttempts=5 + ChallengeVerificationRatePolicy to MfaPolicy
- CompleteMfaChallenge: purpose gate (PasswordLogin/OAuthLogin only),
  multi-attempt with rate limit, revalidate after atomic consume
- SecurityStepUpService: separate StepUpProofStore, rate limiting,
  multi-attempt, post-consume revalidation, proof issued via proof store
- Add IStepUpProofStore + StepUpProofStore (Infra) + InMemory fakes
- Add blocker regression tests: replay rejection, wrong purpose/session/user,
  concurrency single-winner, attempt limit invalidation, purpose isolation
…acts (IA-SEC-001..005)

- ChangePassword: optional StepUpToken consumed (purpose ChangePassword) only
  when user has active MFA; wrong current password never burns a valid proof
- Add SessionRevocationReasons stable vocabulary (Domain) and populate reason
  in ChangePassword/ResetPassword/DisableMfa/RevokeSession/RevokeOtherSessions/Logout
- API: optional StepUpToken on ChangePasswordRequest/endpoint
- Tests: Application step-up matrix (missing/invalid/valid proof, no-burn,
  no-MFA ignores token), Domain reason propagation into UserSessionRevokedDomainEvent,
  Integration ChangePassword step-up matrix on real PG+Redis (9.5 cases incl.
  raw-challenge rejection with no side effect and proof reuse after wrong password)
…dow-bucket flake; derive RFC6238 test secret at runtime
… revocation, listing

Phase 12 (IA-TOK-001..009):
- CreateApiTokenCommand: session-required, single-use step-up proof (IssueApiToken
  purpose), name 1..256, future-only expiration, raw secret returned exactly once
- ApiTokenSecretService: ntk_v1. prefix + 32-byte CSPRNG URL-safe secret,
  SHA-256 digest persisted via TokenHasher, max 512 input bound
- ApiTokenAuthenticationHandler: opt-in "ApiToken" scheme, digest lookup in
  system context, fail-closed on unknown/revoked/expired/user-less, RecordUse
- RevokeApiTokenCommand: immediate revocation, NotFound on id/workspace mismatch,
  semantic no-op when already revoked
- ListApiTokensQuery: metadata-only, ordered by CreatedAt desc, implements
  IWorkspaceRequest/IQuery/IRequirePermission (no allowlist additions)
- Endpoints: GET/POST/DELETE under /api/v1/workspaces/{workspaceId}/api-tokens,
  authenticated + ManageWorkspaceSettings on workspaces.workspace
- RLS: api_tokens policy switched from user-owned to workspace-scoped
  (ops.apply_scoped_business_policies) in 006_policies_identity.sql
- Tests: ApiTokenHandlerTests 10 application scenarios; ApiTokenFlowTests 5
  integration scenarios on real PostgreSQL+Redis (create round-trip, unknown/
  garbage/expired rejection, immediate revocation); Architecture 372, Application
  649, Domain 2576, Infrastructure 120, Platform 147, API 230 all green
…ice and regenerate OpenAPI

- handler ctor takes IApiTokenSecretService (single DI descriptor); concrete
  ApiTokenSecretService was not resolvable by AddScheme activation
- regenerate contracts/openapi/notrelix.v1.json: workspace api-token endpoints
  (Identity.ApiTokens.List/Create/Revoke), additive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant