aidantwoods / go-paseto

Platform-Agnostic Security Tokens implementation in Golang.
https://pkg.go.dev/aidanwoods.dev/go-paseto
MIT License
284 stars 16 forks source link

V4Decrypt Missing? #28

Closed koufopoulosf closed 1 year ago

koufopoulosf commented 1 year ago

Hello,

May I please ask you why the V4Decrypt is missing from the package? Specifically the local version.

I have some issues with finding it.

I would really appreciate your support on that.

Thank you very much for your valuable time.

Best Regards,

Filippos

aidantwoods commented 1 year ago

Hello!

The function you're looking for is named ParseV4Local on a parser instance ๐Ÿ™‚

The parser is responsible for both decryption and validating the token against any loaded rules as an atomic operation (this is a design decision to guide against accidental use of a decrypted token before rules/claims have also been checked, like token expiry).

koufopoulosf commented 1 year ago

Hello,

Thank you very much for your reply!

I would highly appreciate it, if you could provide me a working example using the ParseV4Local๐Ÿ™.

Thank you very much once again!

Best Regards,

Filippos

aidantwoods commented 1 year ago

Here's an example from the tests ๐Ÿ™‚

https://github.com/aidantwoods/go-paseto/blob/48bba7745dc963273b2a95e1b96064ef9a6d7a15/claims_test.go#L106

The non error returned value there is the parsed, decrypted, and validated token. For the local mode, make sure to use the same key (and implicit string if used) as was used to create the token.

koufopoulosf commented 1 year ago

Thank you very much for your reply once again!

Is there any chance that you are available for freelancing to review a code for user auth with pasetoV4 I am making with a friend?

Thank you๐Ÿ™

koufopoulosf commented 1 year ago

Also let me note that the hyperlink on the README.md isn't working:

Paseto is everything you love about JOSE (JWT, JWE, JWS) without any of the many design deficits that plague the JOSE standards.

koufopoulosf commented 1 year ago

Now the hyperlink is working. Thank you very much for your valuable help! Be well :)