tasks/libs/common/githubapp.py
def gen_token_payload(self):
        """
        Generate the token needed to authenticate as a Github App.
        """
        # To get authenticated, you need to use a token with:
        # - iat (creation_time)
        # - exp (expiration time, here 5 minutes since we re-create a token every time we want to authenticate)
        # - iss (the Github app id)
        # and encode it with the private key that's associated with the app.
        # See: https://docs.github.com/en/developers/apps/authenticating-with-github-apps#authenticating-as-a-github-app
        epoch = int(time.time())
        payload = {'iat': epoch, 'exp': epoch + (5 * 60), 'iss': self.app_id}
        return payload

        Generate the token needed to authenticate as a Github App.
        
Generate the token needed to authenticate as a Github App.
Generate the token needed to authenticate as a Github App .
def gen_token_payload(self):
        epoch = int(time.time())
        payload = {'iat': epoch, 'exp': epoch + (5 * 60), 'iss': self.app_id}
        return payload
def gen_token_payload ( self ) : epoch = int ( time . time ( ) ) payload = { 'iat' : epoch , 'exp' : epoch + ( 5 * 60 ) , 'iss' : self . app_id } return payload
Generate the token needed to authenticate as a Github App.
Generate the token needed to authenticate as a Github App .
"""
        Generate the token needed to authenticate as a Github App.
        """ # To get authenticated, you need to use a token with: # - iat (creation_time) # - exp (expiration time, here 5 minutes since we re-create a token every time we want to authenticate) # - iss (the Github app id) # and encode it with the private key that's associated with the app. # See: https://docs.github.com/en/developers/apps/authenticating-with-github-apps#authenticating-as-a-github-app
self