Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplify header canonicalization #3

Merged
merged 3 commits into from
Dec 7, 2015
Merged

Conversation

mdb
Copy link

@mdb mdb commented Dec 2, 2015

Please let me know what you think of this effort to simplify the process by which headers are canonicalized.

Thanks!

mdb added 3 commits December 2, 2015 07:58
Per Akamai API authentication documentation:

- there is no need to specify specific headers to sign; all can/should be signed, which simplifies the code
- there is no need to order the canonicalized headers

See documentation for further clarification:
https://developer.akamai.com/introduction/Client_Auth.html
@mdb
Copy link
Author

mdb commented Dec 2, 2015

As noted in my commit message:

Akamai API authentication documentation suggests:

  • there is no need to specify specific headers to sign; all can/should be signed, which simplifies the code
  • there is no need to order the canonicalized headers

See documentation for further clarification:
https://developer.akamai.com/introduction/Client_Auth.html

Please let me know if I'm mistaken.

@mdb
Copy link
Author

mdb commented Dec 6, 2015

@ktyacke @JonathanBennett Please let me know if you all have thoughts on this PR. Thanks!

@JonathanBennett
Copy link

Hi @mdb - started replying but never finished.

Would be good to have an Akamai opinion here so I'm tagging in @maglietti who might be able to help.

Originally the documentation stated they had to be ordered alphabetically as far as I remember, and the documentation contradicts itself in the example, where they've ordered the headers as they had to be done before. Assumed though this is tested and is working for calls? Haven't had a chance to try it myself yet.

@mdb
Copy link
Author

mdb commented Dec 7, 2015

I'll stay posted for word from @maglietti, though it's my belief this works as desired.

As for testing, I have done some basic acceptance testing, though it's fairly difficult to conduct exhaustive functional/acceptance tests without a suitable Akamai account against which I can perform destructive/modifying actions with no customer-impacting consequence.

As an aside, I would love to be able to utilize a throwaway Akamai GTM domain, etc. against which we can perform such acceptance tests. @ktyacke - curious to hear if Akamai can provide such a thing.

@ktyacke
Copy link

ktyacke commented Dec 7, 2015

@mdb @JonathanBennett Reviewing this now. @maglietti is unfortunately no longer with Akamai, so I will do my best to answer your questions.

@JonathanBennett
Copy link

@mdb @ktyacke If Akamai has such an account for development purposes of libraries that would be awesome.. Kyle?

@ktyacke
Copy link

ktyacke commented Dec 7, 2015

@mdb The changes look good to me. I like the simplification, and think it will make the code a bit easier to digest. One question: I noticed you changed method name "canonicalize_headers" to "canonicalizeHeaders". The majority of the methods in these scripts are named using an underscore syntax. Are you thinking you'd like to move towards using camelCase for the naming convention?

@ktyacke
Copy link

ktyacke commented Dec 7, 2015

@JonathanBennett We don't offer such an account at this time, but I'll look into seeing if this might be a feasible option for future releases. In the mean-time, would you be able to create a "QA" property on your account to test against?

@mdb
Copy link
Author

mdb commented Dec 7, 2015

@ktyacke Regarding the camelCasing, yes, ideally I'd like to standardize on camelCased method/variable names, given that JavaScript itself uses camel casing rather than snake_case. That said, I recognize this is a stylistic preference and I'm open to others' opinions.

@ktyacke
Copy link

ktyacke commented Dec 7, 2015

@mdb I'm actually in favor of camelCasing myself, I just noted that the majority of the code is written using snake_case and wasn't sure if doing such a vast refactor would raise concerns with you or @JonathanBennett If you guys are ok with it, I am as well!

ktyacke added a commit that referenced this pull request Dec 7, 2015
simplify header canonicalization
@ktyacke ktyacke merged commit a35971e into akamai:master Dec 7, 2015
piotrpio added a commit that referenced this pull request Sep 27, 2021
Merge in DEVEXP/akamaiopen-edgegrid-node from TFP-743 to develop

* commit 'c895c6fcfb12e87a5c07905dc791ce27ec114828':
  [TFP-743] Update version of mocha
  [TFP-744] Fix code quality issues
  [TFP-742] Enable debugging in axios
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants