Comments (10)
@roryhewitt The library does not read the first 4 lines, it looks for 'client_token', 'client_secret', 'access_token' and 'host' from the object (containing all other configurations as well and regardless of any order). It might have been a syntax error on the new lines added. If you can reproduce the issue please attach a screen with the error message. Let me know if this helped.
Cheers
from akamaiopen-edgegrid-node.
Hey @joaquin-gimenez here you go...
The first request had my .edgerc file as follows:
[image-manager]
client_secret = fOW...
host = akab-2i2...
access_token = akab-lxw...
client_token = akab-c3c...
and it worked successfully.
Then, I added a 'client_description' value, tried again, and I got the failure.
[image-manager]
client_description = Rory Hewitt
client_secret = fOW...
host = akab-2i2...
access_token = akab-lxw...
client_token = akab-c3c...
Finally, I added the comment after the other 4 lines, and it worked again:
[image-manager]
client_secret = fOW...
host = akab-2i2...
access_token = akab-lxw...
client_token = akab-c3c...
client_description = Rory Hewitt
The fact that it worked when I added the comment after the four 'real' ;lines is what leads me to believe that some where it's only checking the first 4 lines. But obviously I could be wrong :)
from akamaiopen-edgegrid-node.
Here are the commands in the screenshot as copy/paste text:
ERROR:
TypeError: Cannot read property 'replace' of null
at Object.dataToSign (C:\Users\rhewitt\.akamai-cli\src\cli-auth\node_modules\edgegrid\src\helpers.js:72:28)
at Object.signRequest (C:\Users\rhewitt\.akamai-cli\src\cli-auth\node_modules\edgegrid\src\helpers.js:144:39)
at makeAuthHeader (C:\Users\rhewitt\.akamai-cli\src\cli-auth\node_modules\edgegrid\src\auth.js:40:58)
at Object.generateAuth (C:\Users\rhewitt\.akamai-cli\src\cli-auth\node_modules\edgegrid\src\auth.js:65:37)
at EdgeGrid.auth (C:\Users\rhewitt\.akamai-cli\src\cli-auth\node_modules\edgegrid\src\api.js:60:23)
at Promise (C:\Users\rhewitt\.akamai-cli\src\cli-auth\src\egauth.js:91:24)
at new Promise (<anonymous>)
at edgeGridAuth.verify (C:\Users\rhewitt\.akamai-cli\src\cli-auth\src\egauth.js:86:16)
at verify (C:\Users\rhewitt\.akamai-cli\src\cli-auth\bin\akamaiAuth:44:14)
at TypeCommand.run [as _runHandler] (C:\Users\rhewitt\.akamai-cli\src\cli-auth\bin\akamaiAuth:81:20)
from akamaiopen-edgegrid-node.
OK, I suspect the problem is in edgerc.js (part of edgegrid):
function validatedConfig(config) {
if (!(config.host && config.access_token &&
config.client_secret && config.client_token)) {
var errorMessage = "";
var tokens =
['client_token', 'client_secret','access_token','host'];
tokens.forEach(function(token) {
if (!config[token]) {
errorMessage += "\nMissing: " + token;
}
})
console.log('Missing part of the configuration:\n' + errorMessage);
return {};
}
if (config.host.indexOf('https://') > -1) {
return config;
}
config.host = 'https://' + config.host;
return config;
}
That tokens.forEach
will fail, since it's only going to run 4 times (once per token). So if there are any lines which come before any of those tokens, it'll miss them.
from akamaiopen-edgegrid-node.
@roryhewitt thanks for the details, i'll have a look
from akamaiopen-edgegrid-node.
Joaquin, what's the blocker on this one?
Kirsten
from akamaiopen-edgegrid-node.
@synedra this was a bug that was fixed previously, but as cli-auth didn't have the latest edgegrid version, it was not running the fix. I've updated the edgegrid version on cli-auth and with it if you update akamai the issue is fixed
https://github.com/akamai/cli-auth/pull/11
from akamaiopen-edgegrid-node.
Hello @roryhewitt
This bug seems to have been fixed for this package in version 3.0.5. Can you confirm whether we can close the issue?
Thanks
from akamaiopen-edgegrid-node.
@piotrpio Well the code itself looks basically the same, but on running the package, the problem appears to have resolved itself. Let's go ahead and close it -it can always be reopened if it pops back up :)
from akamaiopen-edgegrid-node.
Thanks for letting me know, I'm closing the issue then :)
from akamaiopen-edgegrid-node.
Related Issues (20)
- Why? HOT 1
- DXE-1923 EdgeWorker code upload to sandbox is not supported due to application/tar+gzip Content-Type HOT 3
- [DXE-2050] garbled characters regarding axios recent version. HOT 8
- Request headers not used in request to OPEN API HOT 4
- DXE-2403 Unable to use via an HTTP proxy HOT 3
- DXE-3676 Axios closing the socket, resulting in a HTTP null response to client HOT 1
- README.md .edgerc example HOT 1
- Vulnerability in Request package HOT 6
- Escape unicode characters when body length > max body HOT 1
- P0: Need support for POSTing binary body data HOT 5
- Need option to rate-limit HOT 1
- Use of proxy HOT 1
- Invalid timestamp HOT 1
- Requests that follow 30x redirects return unauthorized. HOT 2
- Plan for alternative to request package? HOT 7
- TypeError: this._setConfigFromStrings is not a function HOT 1
- TypeScript-ize or add TypeScript declaration files? HOT 5
- Upgrading to akamai-edgegrid returning gibberish gzip response HOT 2
- Github version not published on NPM HOT 1
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 akamaiopen-edgegrid-node.