Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(fake-auth): add callback event to fake auth handler #800

Merged
merged 12 commits into from
Oct 28, 2024

Conversation

ToWe0815
Copy link
Contributor

The PR adds a callback event to the fake auth handler to enable the user the manipulation of the created identity before its usage.

A typical use case could be the creation of several mock "users", all having different claims/roles for testing purposes. These "users" are distinguished by having different fake ids, that are getting set via the "x-zitadel-fake-user-id" header when testing typical auth scenarios.

@buehler buehler enabled auto-merge (squash) January 23, 2024 11:52
@buehler
Copy link
Collaborator

buehler commented Jan 23, 2024

Hey @ToWe0815
The tests /linting are failing

auto-merge was automatically disabled January 25, 2024 10:46

Head branch was pushed to by a user without write access

@ToWe0815
Copy link
Contributor Author

Hey @buehler
Should be fixed now!

@buehler
Copy link
Collaborator

buehler commented Jan 25, 2024

Did you update to v6?
GitHub says there are merge conflicts

# Conflicts:
#	src/Zitadel/Authentication/Handler/LocalFakeZitadelHandler.cs
#	src/Zitadel/Authentication/Options/LocalFakeZitadelOptions.cs
#	tests/Zitadel.Test/Authentication/ZitadelFakeAuthenticationHandler.Test.cs
#	tests/Zitadel.Test/WebFactories/FakeAuthenticationHandlerWebFactory.cs
@ToWe0815
Copy link
Contributor Author

Done, my bad.

@ToWe0815
Copy link
Contributor Author

@buehler Is there anything I need to do for this change to be merged? Am I missing something?

@buehler
Copy link
Collaborator

buehler commented Oct 18, 2024

Hey @ToWe0815

Yes, please make sure that the tests are running. Otherwise, I cannot merge it.

@ToWe0815
Copy link
Contributor Author

ToWe0815 commented Oct 18, 2024

Hey @ToWe0815

Yes, please make sure that the tests are running. Otherwise, I cannot merge it.

Hey @buehler

As far as I can see the tests are failing because of a known vulnerability in the 'BouncyCastle.Cryptography' package:
/home/runner/work/zitadel-net/zitadel-net/src/Zitadel/Zitadel.csproj : error NU1902: Warning As Error: Package 'BouncyCastle.Cryptography' 2.2.1 has a known moderate severity vulnerability, https://github.com/advisories/GHSA-8xfc-gm6g-vgpv [/home/runner/work/zitadel-net/zitadel-net/Zitadel.sln]

There are already 2 open PRs regarding this issue (among other similar things):
#930
#926

Semi-Off topic:
The whole project seems to be a bit shaky right now and I think you should take some time to look into open PRs & Issues.

ServiceAccountTest.Should_Throw_With_Meaningful_Error() fails locally on my machine, because the Token Endpoint of the project's Zitadel instance responds with a HTTP 500 when a meaningful error is expected by said test case. This might be due to a change on Zitadel's side and cannot come from my changes made in this PR, since I only added functionality to auth mocking.

Also buf generate doesn't seem to run automagically on build anymore:
#925

I had to execute buf generate manually to make it work, but I'm also not deep enough into the topic to find/fix the problem's source right now.

@buehler
Copy link
Collaborator

buehler commented Oct 28, 2024

Hey @ToWe0815
Thanks to a PR, all the deps are updated. You should be able to fix the linting errors :)

@buehler buehler merged commit b9f626b into smartive:main Oct 28, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants