Commit Graph

53 Commits

Author SHA1 Message Date
Paul Lorenz 6f1c6f004f Stop linking the testing package via boltztest helpers
- swaps testing.TB for require.TestingT in NewTestContext and NextTest,
  so this build-included file no longer imports testing
- removes the write-only t field from BaseTestContext
- documents why the narrower interface is used, so it isn't reverted
2026-08-13 15:37:24 -04:00
Paul Lorenz ff619272ba Enforce api-session and identity revocations on the router. Fixes #3927
The router's CheckConnections reaper enforced only JWT expiry, so a revoked OIDC
api-session, or a disabled/deleted identity, kept its live circuits and hosted
terminators until the access token expired. The router now enforces the
RouterDataModel revocations directly, tightening access-loss propagation to the
reaper interval.

- adds a Type field to DataState_Revocation and the raft Revocation command
  proto, mirroring rest_model.RevocationTypeEnum (API_SESSION/IDENTITY/JTI) so the
  management API, OIDC producers, sync, and router enforcement share one
  vocabulary; the common.RevocationType* constants are compile-time bound to the
  enum to prevent drift
- adds an IssuedBefore cutoff so an identity revocation invalidates only sessions
  issued before it; a session re-authenticated after the cutoff survives the
  still-lingering revocation. Persists IssuedBefore on the db and model Revocation
  and carries it (plus the Type) through the single and batched raft marshalling
- adds RouterDataModel.IsApiSessionRevoked and IsIdentityRevoked and enforces both
  in CheckConnections, closing a revoked session's connections
- revokes a deleted or disabled identity's live OIDC sessions via an
  IdentityRevocationConstraint in the db package, run as a store pre-commit
  constraint so the revocation is written in the same transaction as the identity
  change and cannot be skipped (self-contained OIDC JWTs aren't otherwise
  reachable). NewIdentityManager installs it with the revocation type and lifetime
- has the OIDC end-session (TerminateSessionFromRequest) revoke the specific
  api-session named by the z_asid claim, with an identity-scoped fallback; sets
  IssuedBefore on the identity fallback and the management revocation API; adds
  RevocationManager.CreateOrReplace, routed through by both the OIDC paths and the
  management revocation API, so a repeat logout/termination/revocation refreshes
  the cutoff rather than colliding on the reused id. Expiry derives from the
  longest configured token duration via a shared common.MaxTokenDuration helper
- adds tests/revocation_enforcement_oidc_test.go covering api-session revocation
  (and a fresh session staying unaffected), identity disable and delete, and the
  identity cutoff (a post-cutoff session surviving the lingering revocation)
2026-06-13 01:36:12 -04:00
Paul Lorenz 0ba057e1bf Merge pull request #3918 from openziti/extend-attribute-search
Add role-attribute usage queries. Fixes #1593
2026-06-10 13:00:40 -04:00
Paul Lorenz a582fe5d0f Add role-attribute usage queries. Fixes #1593
- adds management API endpoints listing role-attribute usage for identities,
  edge routers, services, and posture checks, reporting per-source counts
  (and optionally ids via withIds) across home-entity collections and the
  policies that reference each attribute
- adds RoleAttributeUsage model with QueryRoleAttributeUsage, mapping each
  RoleAttributeKind to its contributing sources, with all reads in a single
  transaction so counts stay consistent with the attribute list; returns an
  empty result (not a panic) for kinds with no attributes and an error for
  unknown kinds
- adds boltz.SetIndexValueTransform and AddSetIndexWithTransform, letting a
  SetIndex filter and rewrite symbol values without persisting a derived field
- adds derived role-attribute set indexes to the service policy, edge router
  policy, and service edge router policy stores, built from existing role
  fields via a role-attribute-only transform that excludes the #all wildcard
- adds a db migration that backfills the new indexes via each index's own
  CheckIntegrity(fix=true), scoped to the role-attribute indexes only, with a
  per-index summary log, stopping at the first error
- tests the new endpoints via the typed edge-api management client
2026-06-10 12:39:26 -04:00
Paul Lorenz 83bed76574 Return event-firing error in DeleteById instead of swallowing it. Fixes #3949
- returns the error from changeFlow.fireEvents() so a failed delete rolls back the transaction instead of reporting success
2026-06-09 12:49:24 -04:00
Paul Lorenz 040016993e Fix codespell errors 2026-04-16 09:43:49 -04:00
Paul Lorenz 4df6ae564d Update package paths for newly imported storage and ziti-db-explorer packages 2026-04-16 09:18:55 -04:00
Paul Lorenz c53dad2ba8 Fix incorrect nil check in StringFuncNode. Fixes #122 2025-11-19 18:12:13 -05:00
Paul Lorenz 50c92ac468 Change post tx commit constraint handling order. Fixes #120. Add ContextDecorator API. Fixes #119 2025-11-19 16:25:53 -05:00
Paul Lorenz 51c63f9be1 Update golangci-lint to the latest version 2025-06-11 11:33:56 -04:00
Paul Lorenz d86ec115aa Fix TypedBucket.GetList panic. Fixes #106 2025-06-11 09:51:41 -04:00
Paul Lorenz 10a95d4187 Update deps and go version. Replace use of errorz.MultipleErrors with errors.Join 2025-03-20 09:35:11 -04:00
Paul Lorenz 53b82934cd Fix snapshot path replacement order 2025-01-31 12:19:37 -05:00
Paul Lorenz 9264afb4bc Cleanup snapshot functionality. Fixes #94 2025-01-31 11:45:36 -05:00
Paul Lorenz d39d915fd2 Add ForEachTypedBucket method 2025-01-10 16:30:38 -05:00
Paul Lorenz 7ddde7f735 Support dashes in identifier segments after the first dot. Fixes #91 2024-12-03 14:05:28 -05:00
Paul Lorenz ce06b24d80 Add GetTimeOrDefault method to TypedBucked 2024-11-22 12:42:31 -05:00
Paul Lorenz f526bd5ba4 Have != return true when compared to nil. Fixes #87 2024-11-19 11:27:20 -05:00
Paul Lorenz 7ccc729477 Clean up set index refs when referenced values are deleted. Fixes #80
Also fix related integrity check and improve errors messages
2024-07-23 10:36:13 -04:00
Paul Lorenz 1a7c52091e Implement icontains. Fixes #78 2024-07-17 18:34:59 -04:00
Paul Lorenz 185aa81e18 Add support for external symbols to boltz stores. Fixes #76 2024-07-12 15:29:41 -04:00
Paul Lorenz 53524be824 Fix nillable unique contraint check. Fixes #73 2024-06-14 10:30:02 -04:00
Paul Lorenz 9f43693e44 Add AddFkIndexCascadeDelete. Fixes #71 2024-06-10 13:35:46 -04:00
Paul Lorenz fa0770707c Add support for transaction complete listeners. Fixes #64 2024-04-22 15:13:38 -04:00
Paul Lorenz ca06ba2ae3 Ignore false positives from linter 2023-12-04 10:01:12 -05:00
Paul Lorenz 86212e93db Implement querying collections of in memory objects. Fixes #57 2023-12-01 14:45:04 -05:00
Paul Lorenz ff86b8f23d Grammar should specify single query, not multiple. Fixes #52
Allows parsing of things like updatedAt > datetime(2023-10-02T21:08:58.577Z)sort by updatedAt desc skip 500 limit 500
because when no space is found, the second part is interpreted as a second query
2023-10-03 09:30:11 -04:00
Paul Lorenz ec03de5bf2 Update to latest version of ANTLR. Fixes #31 2023-09-20 16:22:26 -04:00
Paul Lorenz 780e5fc760 Fix spelling error 2023-07-03 09:23:50 -04:00
Paul Lorenz 3bf1626a29 Update entity json from snake to camel case 2023-04-25 15:00:08 -04:00
Paul Lorenz 35492755c0 Remove NilEntity and add some more doc 2023-04-25 11:19:42 -04:00
Paul Lorenz 5b98b3d996 Add GetStore and IsParentEvent to EntityChangeState 2023-04-21 16:52:01 -04:00
Paul Lorenz fb3fc72d16 Tidy some methods 2023-04-17 10:07:55 -04:00
Paul Lorenz 791c6a0e3f Fix order of delete callback. Allow async listeners 2023-04-14 17:00:20 -04:00
Paul Lorenz 8dbcfa68f3 Remove some unused things. Breaking internal and configuration methods 2023-04-12 11:10:26 -04:00
Paul Lorenz eb84973f28 Remove name conflicts so stores can implement EntityStrategy 2023-04-12 11:10:26 -04:00
Paul Lorenz 4fdab09f4f Update batch definition to take context 2023-04-12 11:10:25 -04:00
Paul Lorenz 59da77def9 combine list store and base crud store. Rename to just Store. Rename CrudStore to EntityStore 2023-04-12 11:10:25 -04:00
Paul Lorenz 4fb94e1e67 Tweaks to mutate context 2023-04-12 11:10:25 -04:00
Paul Lorenz 05f511fa9f Get typed events working as expected 2023-04-12 11:10:23 -04:00
Paul Lorenz a715c3d18c Make crud store generic 2023-04-12 11:09:56 -04:00
Paul Lorenz 309db5d8c6 Allow specifying index iteration direction 2023-03-31 17:12:28 -04:00
Paul Lorenz e6e984b619 Allow using traverse on buckets, not just on root 2023-03-21 22:13:58 -04:00
Paul Lorenz 9916d652b9 Add restore from reader method 2023-02-07 09:23:24 -05:00
Paul Lorenz 60c916a600 Add GetComponentVersion and SnapshotToWriter methods 2023-01-13 23:03:39 -05:00
Paul Lorenz 435c40b845 Add linter and update foundation 2022-10-07 11:14:52 -04:00
Paul Lorenz 790a9b4f2c Return empty cursor instead of nil on IterateLinks. Fixes #23 2022-10-06 15:20:53 -04:00
Paul Lorenz acc3c6f063 Support querying tags by default. Fix tag inheritance. Fixes #21 2022-09-14 23:20:15 -04:00
Paul Lorenz 7528fdedc1 Move some code from fabric here. Remove some ziti specific bits. Add snapshot to memory and restore from snapshot 2022-08-19 16:52:22 -04:00
Paul Lorenz ebe47529e0 Remove UpdatedFields type (moved to fabric) 2022-07-27 15:39:13 -04:00