codesmith-gmbh / forge-cogcf-barrier Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
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?
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?
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 ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.