#384 explicitly convert token_lifetime to int before use
Opened a year ago by vitoshalabs. Modified a year ago
vitoshalabs/ipsilon convert_token_lifetime_to_int  into  master

@@ -217,14 +217,14 @@ 

  

          token_security_check = generate_random_secure_string()

          refresh_security_check = generate_random_secure_string(128)

-         expires_in = self.token_lifetime['access']

+         expires_in = int(self.token_lifetime['access'])

  

          token['security_check'] = token_security_check

          token['refresh_security_check'] = refresh_security_check

          token['expires_at'] = int(time.time()) + expires_in

          token['refreshable_until'] = (

              None if self.token_lifetime['refresh'] is None else

-             int(time.time()) + self.token_lifetime['refresh']

+             int(time.time()) + int(self.token_lifetime['refresh'])

          )

  

          self.update_token(token)
@@ -242,7 +242,7 @@ 

                     userinfocode):

          token_security_check = generate_random_secure_string()

  

-         expires_in = self.token_lifetime['access']

+         expires_in = int(self.token_lifetime['access'])

  

          token = {

              'type': 'Bearer',
@@ -260,7 +260,7 @@ 

              token['refreshable'] = True

              token['refreshable_until'] = (

                  None if self.token_lifetime['refresh'] is None else

-                 int(time.time()) + self.token_lifetime['refresh']

+                 int(time.time()) + int(self.token_lifetime['refresh'])

              )

              token['refresh_security_check'] = \

                  generate_random_secure_string(128)

Patch was inspired by same motivation used in f45e9df

Signed-off-by: Vitosha Labs Open Source Team opensource@vitosha-labs.bg

Is there a person behind this commit? It's a bit odd to have a commit authored by a non-person...

Is there a person behind this commit? It's a bit odd to have a commit authored by a non-person...

Sure there is a person it is just company policy not to reveal personal names on our open source contributions, is it something against the policy?
We are using the ipsilon software, found some stuff that can be improved, the patches work for us, if you think they will be useful for the community great, if not ... life goes on :)

Cheers

Metadata