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

Splitting Zitadel-rust project in sub crates #592

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

fcenedes
Copy link

@fcenedes fcenedes commented Feb 5, 2025

Hi there,

Major Changes, Possible Break
This PR is a first attempt to split the zitadel-rust crate into 3 crates :

  • zitadel-rust : Workspace
  • crates/zitadel : Helpers crate around Zitadel API, basically the former crate we all loved.
  • crates/zitadel-gen : Build and generates GRPC stufs from zitadel as Rust Structs and Tonic clients
  • crates/zitadel-examples: Various samples on how to use the zitadel crate

the zitadel-gen could be renamed zitadel-sys or whatever, but it should basicaly hold the same version as the zitadel version where the proto files are extracted.
The zitadel:: is properly re-exported, so if should have no impacts on downstream users

Minor Changes :
zitadel crate :

  • Another little addition, is an helper method to introspect a JWT token locally instead of calling the instrospect endpoint against a Zitadel instance. Note this only work with 3 legs JWT tokens, not opaque one.
  • Another modification is the ability to support arbitrary custom claims, letting the user of this crate to make his own impl
  • One axum deps has been yanked, so the Cargo.toml just reflect that.

the CI/CD needs probably be reviewed and fixed to be aligned if this PR is accepted

Don't be shy, if i wrote crappy code, just let me know :-)

@fcenedes
Copy link
Author

fcenedes commented Feb 5, 2025

well i realise i dont pass some linting. Wonder if i should revert back to buf instead of trying to do it myself :-)

i will amend this pr. Buf actually solve a couple of problems.

Sorry

@buehler
Copy link
Collaborator

buehler commented Feb 7, 2025

Will look into it on the weekend ;)
Splitting the code seems to be a good idea.

and yeah, buf has its perks ;) I learned that the hard way as well.

@buehler
Copy link
Collaborator

buehler commented Feb 7, 2025

One question that comes to mind: why use a third crate for examples? As far as I know in Rust people show examples inside the crate. Those are not compiled when the crate is downloaded right?

@fcenedes
Copy link
Author

fcenedes commented Feb 7, 2025

no particular reason, i will move them back into the zitadel crate.
EDIT : now i remember, i took inspiration from https://github.com/apache/datafusion/tree/main/datafusion-examples
probably to have them isolated from the main crate..but anyway :)

@fcenedes
Copy link
Author

you will have to exclude cargo clippy for the generated Tonic code.

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