Giter Club home page Giter Club logo

forge-cogcf-barrier's People

Contributors

stanislas avatar

Watchers

 avatar  avatar

Forkers

tastefulelk

forge-cogcf-barrier's Issues

Internal server Error on lambda session_manager.py excecution

Hi, when i do a get, i get a "internal server error". If I goes to cloudwatch i can see this:

[ERROR] TypeError: 'NoneType' object is not subscriptable Traceback (most recent call last): File "/var/task/session_manager.py", line 37, in handler return self.handle_auth(event) File "/var/task/session_manager.py", line 87, in handle_auth code = params['code']

I modified the script session_manager.py to log the params var and i realized that it is None...so i've print the output of event var and i see this:

'httpMethod': 'GET', 'headers': {'Accept-Encoding': 'gzip', 'Cache-Control': 'max-age=0', 'Cookie': 'TestBarrierLogin=uVY6W1Nr80EUHhNJdK-ya5qP4IePhsMSktVJOalKXBeEWy6SvWLTtOGGiwrQe6ZbnGkYz0Ij206GYrqvpkV-zg', 'Host': 'ci5yakdpn0.execute-api.us-east-1.amazonaws.com', 'sec-ch-ua': '"Google Chrome";v="87", " Not;A Brand";v="99", "Chromium";v="87"', 'sec-ch-ua-mobile': '?0', 'sec-fetch-dest': 'document', 'sec-fetch-mode': 'navigate', 'sec-fetch-site': 'cross-site', 'sec-fetch-user': '?1', 'upgrade-insecure-requests': '1', 'User-Agent': 'Amazon CloudFront', 'Via': '2.0 fd261d7f0b1b36c094af45d7484bb70d.cloudfront.net (CloudFront)', 'X-Amz-Cf-Id': 'X9PBVQ_CDimWVyWdoJh-Y53CcetvxUAAYKP346gBTDaAkhbyIRnhnQ==', 'X-Amzn-Trace-Id': 'Root=1-5fecdb43-32c2800c4fe6798a4f58b499', 'X-Forwarded-For': '190.183.60.117, 64.252.175.83', 'X-Forwarded-Port': '443', 'X-Forwarded-Proto': 'https'}, 'multiValueHeaders': {'Accept-Encoding': ['gzip'], 'Cache-Control': ['max-age=0'], 'Cookie': ['TestBarrierLogin=uVY6W1Nr80EUHhNJdK-ya5qP4IePhsMSktVJOalKXBeEWy6SvWLTtOGGiwrQe6ZbnGkYz0Ij206GYrqvpkV-zg'], 'Host': ['ci5yakdpn0.execute-api.us-east-1.amazonaws.com'], 'sec-ch-ua': ['"Google Chrome";v="87", " Not;A Brand";v="99", "Chromium";v="87"'], 'sec-ch-ua-mobile': ['?0'], 'sec-fetch-dest': ['document'], 'sec-fetch-mode': ['navigate'], 'sec-fetch-site': ['cross-site'], 'sec-fetch-user': ['?1'], 'upgrade-insecure-requests': ['1'], 'User-Agent': ['Amazon CloudFront'], 'Via': ['2.0 fd261d7f0b1b36c094af45d7484bb70d.cloudfront.net (CloudFront)'], 'X-Amz-Cf-Id': ['X9PBVQ_CDimWVyWdoJh-Y53CcetvxUAAYKP346gBTDaAkhbyIRnhnQ=='], 'X-Amzn-Trace-Id': ['Root=1-5fecdb43-32c2800c4fe6798a4f58b499'], 'X-Forwarded-For': ['190.183.60.117, 64.252.175.83'], 'X-Forwarded-Port': ['443'], 'X-Forwarded-Proto': ['https']}, 'queryStringParameters': None, 'multiValueQueryStringParameters': None, 'pathParameters': None, 'stageVariables': None, 'requestContext': {'resourceId': 'et0i66', 'resourcePath': '/_identity/auth', 'httpMethod': 'GET', 'extendedRequestId': 'YYcyoH3rIAMFSiQ=', 'requestTime': '30/Dec/2020:19:55:47 +0000', 'path': '/prod/_identity/auth', 'accountId': '601035752132', 'protocol': 'HTTP/1.1', 'stage': 'prod', 'domainPrefix': 'ci5yakdpn0', 'requestTimeEpoch': 1609358147978, 'requestId': 'f6adf8e6-bb47-483c-b216-13f25bf69147', 'identity': {'cognitoIdentityPoolId': None, 'accountId': None, 'cognitoIdentityId': None, 'caller': None, 'sourceIp': '190.183.60.117', 'principalOrgId': None, 'accessKey': None, 'cognitoAuthenticationType': None, 'cognitoAuthenticationProvider': None, 'userArn': None, 'userAgent': 'Amazon CloudFront', 'user': None}, 'domainName': 'ci5yakdpn0.execute-api.us-east-1.amazonaws.com', 'apiId': 'ci5yakdpn0'}, 'body': None, 'isBase64Encoded': False}

The function that fail do this:

    def handle_auth(self, event):
        params = event['queryStringParameters']
        code = params['code']
        event_state = json.loads(base64.urlsafe_b64decode(params['state']).decode())
        secret = event_state['secret']
        event_path = urllib.parse.unquote(event_state['path'])
        identity = self.verify_identity(event=event, code=code, secret=secret)
        if identity:
            return self.auth_response(identity, event_path)
        else:
            return self.logout_response()

And the 'queryStringParameters' has "None". I don't know why.
Can anyone help with this?

Error en lambda excecution: [ERROR] TypeError: 'NoneType' object is not subscriptable

Hi, when i do a get, i get a "internal server error". If I goes to cloudwatch i can see this:

[ERROR] TypeError: 'NoneType' object is not subscriptable Traceback (most recent call last): File "/var/task/session_manager.py", line 37, in handler return self.handle_auth(event) File "/var/task/session_manager.py", line 87, in handle_auth code = params['code']

I modified the script session_manager.py to log the params var and i realized that it is None...so i've print the output of event var and i see this:

'httpMethod': 'GET', 'headers': {'Accept-Encoding': 'gzip', 'Cache-Control': 'max-age=0', 'Cookie': 'TestBarrierLogin=uVY6W1Nr80EUHhNJdK-ya5qP4IePhsMSktVJOalKXBeEWy6SvWLTtOGGiwrQe6ZbnGkYz0Ij206GYrqvpkV-zg', 'Host': 'ci5yakdpn0.execute-api.us-east-1.amazonaws.com', 'sec-ch-ua': '"Google Chrome";v="87", " Not;A Brand";v="99", "Chromium";v="87"', 'sec-ch-ua-mobile': '?0', 'sec-fetch-dest': 'document', 'sec-fetch-mode': 'navigate', 'sec-fetch-site': 'cross-site', 'sec-fetch-user': '?1', 'upgrade-insecure-requests': '1', 'User-Agent': 'Amazon CloudFront', 'Via': '2.0 fd261d7f0b1b36c094af45d7484bb70d.cloudfront.net (CloudFront)', 'X-Amz-Cf-Id': 'X9PBVQ_CDimWVyWdoJh-Y53CcetvxUAAYKP346gBTDaAkhbyIRnhnQ==', 'X-Amzn-Trace-Id': 'Root=1-5fecdb43-32c2800c4fe6798a4f58b499', 'X-Forwarded-For': '190.183.60.117, 64.252.175.83', 'X-Forwarded-Port': '443', 'X-Forwarded-Proto': 'https'}, 'multiValueHeaders': {'Accept-Encoding': ['gzip'], 'Cache-Control': ['max-age=0'], 'Cookie': ['TestBarrierLogin=uVY6W1Nr80EUHhNJdK-ya5qP4IePhsMSktVJOalKXBeEWy6SvWLTtOGGiwrQe6ZbnGkYz0Ij206GYrqvpkV-zg'], 'Host': ['ci5yakdpn0.execute-api.us-east-1.amazonaws.com'], 'sec-ch-ua': ['"Google Chrome";v="87", " Not;A Brand";v="99", "Chromium";v="87"'], 'sec-ch-ua-mobile': ['?0'], 'sec-fetch-dest': ['document'], 'sec-fetch-mode': ['navigate'], 'sec-fetch-site': ['cross-site'], 'sec-fetch-user': ['?1'], 'upgrade-insecure-requests': ['1'], 'User-Agent': ['Amazon CloudFront'], 'Via': ['2.0 fd261d7f0b1b36c094af45d7484bb70d.cloudfront.net (CloudFront)'], 'X-Amz-Cf-Id': ['X9PBVQ_CDimWVyWdoJh-Y53CcetvxUAAYKP346gBTDaAkhbyIRnhnQ=='], 'X-Amzn-Trace-Id': ['Root=1-5fecdb43-32c2800c4fe6798a4f58b499'], 'X-Forwarded-For': ['190.183.60.117, 64.252.175.83'], 'X-Forwarded-Port': ['443'], 'X-Forwarded-Proto': ['https']}, 'queryStringParameters': None, 'multiValueQueryStringParameters': None, 'pathParameters': None, 'stageVariables': None, 'requestContext': {'resourceId': 'et0i66', 'resourcePath': '/_identity/auth', 'httpMethod': 'GET', 'extendedRequestId': 'YYcyoH3rIAMFSiQ=', 'requestTime': '30/Dec/2020:19:55:47 +0000', 'path': '/prod/_identity/auth', 'accountId': '601035752132', 'protocol': 'HTTP/1.1', 'stage': 'prod', 'domainPrefix': 'ci5yakdpn0', 'requestTimeEpoch': 1609358147978, 'requestId': 'f6adf8e6-bb47-483c-b216-13f25bf69147', 'identity': {'cognitoIdentityPoolId': None, 'accountId': None, 'cognitoIdentityId': None, 'caller': None, 'sourceIp': '190.183.60.117', 'principalOrgId': None, 'accessKey': None, 'cognitoAuthenticationType': None, 'cognitoAuthenticationProvider': None, 'userArn': None, 'userAgent': 'Amazon CloudFront', 'user': None}, 'domainName': 'ci5yakdpn0.execute-api.us-east-1.amazonaws.com', 'apiId': 'ci5yakdpn0'}, 'body': None, 'isBase64Encoded': False}
The function that fail do this:
def handle_auth(self, event): params = event['queryStringParameters'] code = params['code'] event_state = json.loads(base64.urlsafe_b64decode(params['state']).decode()) secret = event_state['secret'] event_path = urllib.parse.unquote(event_state['path']) identity = self.verify_identity(event=event, code=code, secret=secret) if identity: return self.auth_response(identity, event_path) else: return self.logout_response()
And the 'queryStringParameters' has "None". I don't know why.
Can anyone help with this?

cannot deploy application using poetry

Currently trying to follow your tutorial and which i run the command poetry run -- deploy -f test-assembly.yaml if get the error below.


[FileNotFoundError]
[Errno 2] No such file or directory

Not entirely sure why this is happening and all the fixes around this error and poetry are not working. have you run into this issue before ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.