Commit Graph

678 Commits

Author SHA1 Message Date
Iraq Jaber
5e3951c7f8 fixup! fixup! Merge branch 'main' into org_api 2025-05-21 16:36:44 +02:00
Iraq Jaber
5af4e3b7aa fixup! Merge branch 'main' into org_api 2025-05-21 14:50:00 +02:00
Iraq Jaber
01b263d7cb Merge branch 'main' into org_api 2025-05-21 14:36:09 +02:00
Iraq Jaber
390c694b46 fixup! fixup! Merge branch 'org_api_docs' into org_api 2025-05-21 14:28:19 +02:00
Iraq Jaber
cb2c2e77bf fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Merge branch 'main' into org_api 2025-05-21 12:52:12 +02:00
Iraq Jaber
83a5371fe6 fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Merge branch 'main' into org_api 2025-05-21 10:34:52 +02:00
Iraq Jaber
733b0852d5 fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Merge branch 'main' into org_api 2025-05-20 14:11:40 +02:00
Iraq Jaber
1fde70ff7c fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Merge branch 'main' into org_api 2025-05-20 11:37:11 +02:00
Iraq Jaber
477fb8aba6 fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Merge branch 'main' into org_api 2025-05-20 10:35:23 +02:00
Iraq Jaber
5bdc19a6c0 fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Merge branch 'main' into org_api 2025-05-19 18:15:18 +02:00
Iraq Jaber
fe74d6b88d fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Merge branch 'main' into org_api 2025-05-19 17:22:50 +02:00
Iraq Jaber
f9e9f9cdff fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Merge branch 'main' into org_api 2025-05-12 09:00:03 +02:00
Iraq Jaber
5f014d6057 fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Merge branch 'main' into org_api 2025-05-08 20:39:49 +02:00
Iraq Jaber
a26ccd5393 fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Merge branch 'main' into org_api 2025-05-08 20:33:34 +02:00
Elio Bischof
898366c537 fix: allow user self deletion (#9828)
# Which Problems Are Solved

Currently, users can't delete themselves using the V2 RemoveUser API
because of the redunant API middleware permission check.

On main, using a machine user PAT to delete the same machine user:

```bash
grpcurl -plaintext -H "Authorization: Bearer ${ZITADEL_ACCESS_TOKEN}" -d '{"userId": "318838604669387137"}' localhost:8080 zitadel.user.v2.UserService.DeleteUser
ERROR:
  Code: NotFound
  Message: membership not found (AUTHZ-cdgFk)
  Details:
  1)	{
    	  "@type": "type.googleapis.com/zitadel.v1.ErrorDetail",
    	  "id": "AUTHZ-cdgFk",
    	  "message": "membership not found"
    	}
```

Same on this PRs branch:

```bash
grpcurl -plaintext -H "Authorization: Bearer ${ZITADEL_ACCESS_TOKEN}" -d '{"userId": "318838604669387137"}' localhost:8080 zitadel.user.v2.UserService.DeleteUser
{
  "details": {
    "sequence": "3",
    "changeDate": "2025-05-06T13:44:54.349048Z",
    "resourceOwner": "318838541083804033"
  }
}
```

Repeated call
```bash
grpcurl -plaintext -H "Authorization: Bearer ${ZITADEL_ACCESS_TOKEN}" -d '{"userId": "318838604669387137"}' localhost:8080 zitadel.user.v2.UserService.DeleteUser
ERROR:
  Code: Unauthenticated
  Message: Errors.Token.Invalid (AUTH-7fs1e)
  Details:
  1)	{
    	  "@type": "type.googleapis.com/zitadel.v1.ErrorDetail",
    	  "id": "AUTH-7fs1e",
    	  "message": "Errors.Token.Invalid"
    	}
```

# How the Problems Are Solved

The middleware permission check is disabled and the
domain.PermissionCheck is used exclusively.

# Additional Changes

A new type command.PermissionCheck allows to optionally accept a
permission check for commands, so APIs with middleware permission checks
can omit redundant permission checks by passing nil while APIs without
middleware permission checks can pass one to the command.

# Additional Context

This is a subtask of #9763

---------

Co-authored-by: Livio Spring <livio.a@gmail.com>
2025-05-07 15:24:24 +02:00
Iraq Jaber
34892286bf fixup! fixup! fixup! fixup! Merge branch 'main' into org_api 2025-05-07 14:04:51 +02:00
Iraq Jaber
06bc789b99 fixup! fixup! fixup! Merge branch 'main' into org_api 2025-05-07 13:57:08 +02:00
Iraq Jaber
73eb43bb87 fixup! fixup! Merge branch 'main' into org_api 2025-05-07 13:46:17 +02:00
Iraq Jaber
25d4f1af78 fixup! Merge branch 'main' into org_api 2025-05-07 13:36:50 +02:00
Iraq Jaber
7383c24931 Merge branch 'main' into org_api 2025-05-07 09:26:32 +02:00
Iraq Jaber
4eb67cebcc fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! adding more tests for ListOrganization() 2025-05-07 09:02:56 +02:00
Iraq Jaber
1a05c41614 fixup! fixup! fixup! fixup! fixup! adding more tests for ListOrganization() 2025-05-06 17:29:26 +02:00
Iraq Jaber
6fa53113c5 fixup! fixup! fixup! adding more tests for ListOrganization() 2025-05-06 14:58:01 +02:00
Iraq Jaber
686079ba66 fixup! fixup! adding more tests for ListOrganization() 2025-05-06 14:04:17 +02:00
Iraq Jaber
1d7c414f87 fixup! adding more tests for ListOrganization() 2025-05-06 09:09:30 +02:00
Iraq Jaber
4f340dc973 adding more tests for ListOrganization() 2025-05-05 15:23:28 +02:00
Iraq Jaber
932cebcd54 fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! refactor(api): moving organization API resourced based 2025-05-05 11:17:54 +02:00
Iraq Jaber
76cc92e5d7 fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! refactor(api): moving organization API resourced based 2025-05-05 11:03:25 +02:00
Iraq Jaber
c7b6a2f4df fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! refactor(api): moving organization API resourced based 2025-05-05 10:46:41 +02:00
Iraq Jaber
2105dd232a fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! refactor(api): moving organization API resourced based 2025-05-05 09:33:40 +02:00
Iraq Jaber
b8498e89ee fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! refactor(api): moving organization API resourced based 2025-05-04 18:00:38 +02:00
Iraq Jaber
492ac01af4 fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! refactor(api): moving organization API resourced based 2025-05-04 16:58:25 +02:00
Iraq Jaber
e7d1939012 fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! refactor(api): moving organization API resourced based 2025-05-04 15:53:33 +02:00
Iraq Jaber
80f61aefc9 fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! refactor(api): moving organization API resourced based 2025-05-03 12:42:05 +02:00
Iraq Jaber
3e482e501e fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! refactor(api): moving organization API resourced based 2025-05-03 12:38:45 +02:00
Iraq Jaber
9dbcfc255d fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! refactor(api): moving organization API resourced based
added all Domain related endpoinds, testing not complete
2025-05-02 19:00:09 +02:00
Livio Spring
b1e60e7398 Merge commit from fork
* fix: prevent intent token reuse and add expiry

* fix duplicate

* fix expiration
2025-05-02 13:44:24 +02:00
Iraq Jaber
4d5cbc94e2 fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! refactor(api): moving organization API resourced based
added AddOrganizationDomain & ListOrganizationDomain()
2025-05-02 12:10:30 +02:00
Iraq Jaber
96831fb5f5 fixup! fixup! fixup! fixup! fixup! fixup! fixup! refactor(api): moving organization API resourced based
added Deactivate/ActivateOrg
2025-05-01 12:37:14 +02:00
Elio Bischof
74ace1aec3 fix(actions): default sorting column to creation date (#9795)
# Which Problems Are Solved

The sorting column of action targets and executions defaults to the ID
column instead of the creation date column.
This is only relevant, if the sorting column is explicitly passed as
unspecified.
If the sorting column is not passed, it correctly defaults to the
creation date.

```bash
#  Sorts by ID
grpcurl -plaintext -H "Authorization: Bearer ${ZITADEL_ACCESS_TOKEN}" -d '{"sortingColumn": "TARGET_FIELD_NAME_UNSPECIFIED"}' localhost:8080 zitadel.action.v2beta.ActionService.ListTargets
#  Sorts by ID
grpcurl -plaintext -H "Authorization: Bearer ${ZITADEL_ACCESS_TOKEN}" -d '{"sortingColumn": 0}' localhost:8080 zitadel.action.v2beta.ActionService.ListTargets
#  Sorts by creation date
grpcurl -plaintext -H "Authorization: Bearer ${ZITADEL_ACCESS_TOKEN}" localhost:8080 zitadel.action.v2beta.ActionService.ListTargets
``` 

# How the Problems Are Solved

`action.TargetFieldName_TARGET_FIELD_NAME_UNSPECIFIED` maps to the
sorting column `query.TargetColumnCreationDate`.

# Additional Context

As IDs are also generated in ascending, like creation dates, the the bug
probably only causes unexpected behavior for cases, where the ID is
specified during target or execution creation. This is currently not
supported, so this bug probably has no impact at all. It doesn't need to
be backported.

Found during implementation of #9763

Co-authored-by: Livio Spring <livio.a@gmail.com>
2025-05-01 05:41:57 +00:00
Stefan Benz
3953879fe9 fix: correct unmarshalling of IdP user when using Google (#9799)
# Which Problems Are Solved

Users from Google IDP's are not unmarshalled correctly in intent
endpoints and not returned to callers.

# How the Problems Are Solved

Provided correct type for unmarshalling of the information.

# Additional Changes

None

# Additional Context

None

---------

Co-authored-by: Livio Spring <livio.a@gmail.com>
2025-04-30 09:12:48 +00:00
Iraq Jaber
40de3d462a fixup! fixup! fixup! fixup! fixup! fixup! refactor(api): moving organization API resourced based
added DeleteOrganization()
2025-04-30 10:16:22 +02:00
Tim Möhlmann
91bc71db74 fix(instance): add web key generation to instance defaults (#9815)
# Which Problems Are Solved

Webkeys were not generated with new instances when the webkey feature
flag was enabled for instance defaults. This would cause a redirect loop
with console for new instances on QA / coud.

# How the Problems Are Solved

- uncomment the webkeys section on defaults.yaml
- Fix field naming of webkey config

# Additional Changes

- Add all available features as comments.
- Make the improved performance type enum parsable from the config,
untill now they were just ints.
- Running of the enumer command created missing enum entries for feature
keys.

# Additional Context

- Needs to be back-ported to v3 / next-rc

Co-authored-by: Livio Spring <livio.a@gmail.com>
2025-04-29 14:54:53 +00:00
Iraq Jaber
0121478b93 fixup! fixup! fixup! fixup! refactor(api): moving organization API resourced based
added ListOrganizations() tests incompletel
2025-04-29 14:01:16 +02:00
Iraq Jaber
6d73b8e3ad fixup! fixup! fixup! refactor(api): moving organization API resourced based
adding getOrganization
2025-04-28 14:00:54 +02:00
Stefan Benz
b8ba7bd5ba fix: remove action feature flag and include execution (#9727)
# Which Problems Are Solved

Actions v2 is not a feature flag anymore, include functionality on
executions is not used and json tags of proto messages are handled
incorrectly.

# How the Problems Are Solved

- Remove actions from the feature flags on system and instance level
- Remove include type on executions, only in the API, later maybe in the
handling logic as well
- Use protojson in request and response handling of actions v2

# Additional Changes

- Correct integration tests for request and response handling
- Use json.RawMessage for events, so that the event payload is not
base64 encoded
- Added separate context for async webhook calls, that executions are
not cancelled when called async

# Additional Context

Related to #9759 
Closes #9710

---------

Co-authored-by: Livio Spring <livio.a@gmail.com>
2025-04-28 11:24:50 +02:00
Iraq Jaber
56bacaf809 fixup! fixup! refactor(api): moving organization API resourced based
added updateOrganization
2025-04-25 14:47:39 +02:00
Iraq Jaber
aad8961bf3 refactor(api): moving organization API resourced based 2025-04-24 12:17:45 +02:00
Tim Möhlmann
a2f60f2e7a perf(query): org permission function for resources (#9677)
# Which Problems Are Solved

Classic permission checks execute for every returned row on resource
based search APIs. Complete background and problem definition can be
found here: https://github.com/zitadel/zitadel/issues/9188

# How the Problems Are Solved

- PermissionClause function now support dynamic query building, so it
supports multiple cases.
- PermissionClause is applied to all list resources which support org
level permissions.
- Wrap permission logic into wrapper functions so we keep the business
logic clean.

# Additional Changes

- Handle org ID optimization in the query package, so it is reusable for
all resources, instead of extracting the filter in the API.
- Cleanup and test system user conversion in the authz package. (context
middleware)
- Fix: `core_integration_db_up` make recipe was missing the postgres
service.

# Additional Context

- Related to https://github.com/zitadel/zitadel/issues/9190
2025-04-15 18:38:25 +02:00
Fabienne Bühler
07ce3b6905 chore!: Introduce ZITADEL v3 (#9645)
This PR summarizes multiple changes specifically only available with
ZITADEL v3:

- feat: Web Keys management
(https://github.com/zitadel/zitadel/pull/9526)
- fix(cmd): ensure proper working of mirror
(https://github.com/zitadel/zitadel/pull/9509)
- feat(Authz): system user support for permission check v2
(https://github.com/zitadel/zitadel/pull/9640)
- chore(license): change from Apache to AGPL
(https://github.com/zitadel/zitadel/pull/9597)
- feat(console): list v2 sessions
(https://github.com/zitadel/zitadel/pull/9539)
- fix(console): add loginV2 feature flag
(https://github.com/zitadel/zitadel/pull/9682)
- fix(feature flags): allow reading "own" flags
(https://github.com/zitadel/zitadel/pull/9649)
- feat(console): add Actions V2 UI
(https://github.com/zitadel/zitadel/pull/9591)

BREAKING CHANGE
- feat(webkey): migrate to v2beta API
(https://github.com/zitadel/zitadel/pull/9445)
- chore!: remove CockroachDB Support
(https://github.com/zitadel/zitadel/pull/9444)
- feat(actions): migrate to v2beta API
(https://github.com/zitadel/zitadel/pull/9489)

---------

Co-authored-by: Livio Spring <livio.a@gmail.com>
Co-authored-by: Stefan Benz <46600784+stebenz@users.noreply.github.com>
Co-authored-by: Silvan <27845747+adlerhurst@users.noreply.github.com>
Co-authored-by: Ramon <mail@conblem.me>
Co-authored-by: Elio Bischof <elio@zitadel.com>
Co-authored-by: Kenta Yamaguchi <56732734+KEY60228@users.noreply.github.com>
Co-authored-by: Harsha Reddy <harsha.reddy@klaviyo.com>
Co-authored-by: Livio Spring <livio@zitadel.com>
Co-authored-by: Max Peintner <max@caos.ch>
Co-authored-by: Iraq <66622793+kkrime@users.noreply.github.com>
Co-authored-by: Florian Forster <florian@zitadel.com>
Co-authored-by: Tim Möhlmann <tim+github@zitadel.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Max Peintner <peintnerm@gmail.com>
2025-04-02 16:53:06 +02:00