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

Implemention of more methods to make biscuit-php usable #1

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

Conversation

alyrow
Copy link

@alyrow alyrow commented May 29, 2023

I have implemented some more methods to make this php binding usable:

  • Added methods from_base64 and to_base64 into Biscuit class for allowing some de/serializations
  • Added method authorizer into Biscuit class to get an Authorizer object in order to test our rules on the biscuit
  • Added method build into BiscuitBuilder to get a Biscuit from a BiscuitBuilder
  • Changed constructors, from_... and to_hex methods in KeyPair, PublicKey and PrivateKey classes to handle strings instead of bytes since in my tests I was unable to load a private key from a string
  • Added method query into Authorizer class. It's more an hack than a functional thing but I don't have the time to do it properly: instead of returning a list, it returns a string like this: "term1"|"term2"|3

@ptondereau
Copy link
Owner

ptondereau commented May 29, 2023

Hey @alyrow thanks for your awesome PR!
Before merging this PR, it would be more consistent to upgrade biscuit deps to v3 instead of alpha one and also ext-php-rs to v0.10

@alyrow
Copy link
Author

alyrow commented May 29, 2023

Yep sure

@ptondereau
Copy link
Owner

ptondereau commented May 29, 2023

Thank you, looks good, just need to fix php tests

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.

2 participants