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

Think about allowing auth_user_param point to a value from a nested structure #20

Open
barseghyanartur opened this issue Aug 5, 2021 · 0 comments

Comments

@barseghyanartur
Copy link
Owner

Consider the following payload:

{
   "company":{
      "name":"Royal Lafleur",
      "website":"http://google.com"
   },
   "user":{
      "first_name":"Yinthe",
      "last_name":"van Dagsburg",
      "email":"[email protected]"
   },
   "shipping_address":{
      "street":"Ivyweg",
      "house_number":"8",
      "city":"Schore",
      "postal_code":"8374IE",
      "country":"NL"
   },
   "billing_address":{
      "street":"Femkeboulevard",
      "house_number":"7",
      "city":"Hallum",
      "postal_code":"5594TA",
      "country":"NL"
   },
   "amount":1277179,
   "currency":"EUR"
}

Then something like this should be possible:

signature_to_dict(
    auth_user=payload["user"]["email"],
    secret_key=SECRET_KEY,
    extra=payload,
    auth_user_param="user.email",
)

Think about the best separator (might be the dot).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant