Comments (6)
https://forums.aws.amazon.com/thread.jspa?messageID=767716 here is the issue from 2017
from aws-data-lake-solution.
is this a CORS issue? the datalakeweb bucket does not have CORS enabled.
from aws-data-lake-solution.
We apologize for the inconvenience. We are currently researching the issue on our end. Please continue to monitor the repository for updates.
from aws-data-lake-solution.
Hi @stevejonpeters -
Below is an example of constructing an API call to v2.1.0 of Data Lake that was tested on the Python 3.7 Lambda runtime using requests v2.22.0. The API returns a 200 status code with a JSON payload as the response body.
The commented lines in getSignatureKey
are the JavaScript versions of the code from our API documentation.
The access_key
and secret_key
needed to generate the signing key will both come from the Data Lake console (details here) so there should be no need to compare with Cognito.
Can you please compare the below with how you are constructing the signing key and the API request?
import os, base64, datetime, hashlib, hmac
import requests
def getSignatureKey(accessKey, secretKey, dateStamp, apiEndpoint):
# let kDate = crypto.createHmac('sha256', "DATALAKE4" + secretKey);
# kDate.update(moment().utc().format("YYYYMMDD"));
kDate = hmac.new(f"DATALAKE4{secretKey}".encode('utf-8'), dateStamp.encode('utf-8'), hashlib.sha256)
# let kEndpoint = crypto.createHmac('sha256', kDate.digest('base64'));
# kEndpoint.update(apiEndpoint);
kEndpoint = hmac.new(base64.b64encode(kDate.digest()), apiEndpoint.encode('utf-8'), hashlib.sha256)
# let kService = crypto.createHmac('sha256', kEndpoint.digest('base64'));
# kService.update('datalake');
kService = hmac.new(base64.b64encode(kEndpoint.digest()), "datalake".encode('utf-8'), hashlib.sha256)
# let kSigning = crypto.createHmac('sha256', kService.digest('base64'));
# kSigning.update("datalake4_request");
kSigning = hmac.new(base64.b64encode(kService.digest()), "datalake4_request".encode('utf-8'), hashlib.sha256)
# let _signature = kSigning.digest('base64');
_signature = base64.b64encode(kSigning.digest()).decode('utf-8')
# let _apiKey = [accessKey, _signature].join(':');
# let _authKey = Base64.encode(_apiKey);
_apiKey = ":".join([accessKey, _signature])
_authKey = base64.b64encode(_apiKey.encode('utf-8')).decode('utf-8')
# return ['ak', _authKey].join(':');
return ":".join(["ak", _authKey])
access_key = os.environ.get('KEY')
secret_key = os.environ.get('SECRET')
api_endpoint = os.environ.get('API_ENDPOINT')
sign_key = getSignatureKey(access_key, secret_key, datetime.datetime.utcnow().strftime('%Y%m%d'), api_endpoint)
headers = {'Auth':sign_key}
request_url = f"https://{api_endpoint}/prod/search?term=test"
r = requests.get(request_url, headers=headers)
print(f"Response code: {r.status_code}")
print(r.text)
from aws-data-lake-solution.
Hi @stevejonpeters are you still facing this issue. Did the example provided by eric help you to find a solution. If the problem is resolved, can you please close the issue.
from aws-data-lake-solution.
Closing this issue, but please let us know if you need additional assistance.
from aws-data-lake-solution.
Related Issues (20)
- 502 error from /prod/cart HOT 2
- package ids beginning with dash cant be deleted properly HOT 2
- some chars in autogenerated passwords not accepted by login page HOT 2
- Okta federation instructions forgets to update lambda variables HOT 1
- fs.writeFile throws ERR_INVALID_CALLBACK error HOT 2
- latest npm package for elasticsearch 16.x is not working. HOT 2
- Error during deployment: create failed DataLakeKibanaCognito HOT 4
- Adding API Access for user not providing Secret Access Key via pop up per docs HOT 1
- Blank Manifest files generated from Cart HOT 4
- Cloudformation failing HOT 5
- Can not see package on dashboard
- Signing API Request to application HOT 4
- using EOL framework in example code
- Deployment from source fails, from webpage deployment works HOT 1
- Link to documentation returns a 403 HOT 2
- README.md - Fixing typos
- Bug report: Unable to create "S3LoggingBucket" due to InvalidBucketAclWithObjectOwnership
- Bug report: failed to create "DataLakeHelper" due to "nodejs12.x" which is no longer supported
- Cloudformation Stack Error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-data-lake-solution.