-
Notifications
You must be signed in to change notification settings - Fork 20
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
Auth API cleanup - First steps #119
Conversation
3ddc7d9
to
c3dfe36
Compare
auth.check = (request, log, awsService, data) => { | ||
log.debug('running auth checks', { method: 'auth' }); | ||
function extractParams(request, log, awsService, data) { | ||
log.trace('extracting authentication signature informations'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
informations s/b information
do we want to use the "method" log format instead and state the function name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by log format, do you mean the logged dictionnary ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as in {method: extractParams}
9a43094
to
3267fd0
Compare
const payloadChecksum = crypto.createHash('sha256').update(payload) | ||
.digest('hex'); | ||
const path = request.path; | ||
Object.assign(request, { path: '/' }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should come out. I did pr to remove but it appears the rebase did not catch it since the function changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you point me and @AntoninCoulibaly (who will take up these PRs in my absence) to the PR in question ? this would greatly help
3267fd0
to
e612e7f
Compare
const authHeader = request.headers.authorization; | ||
// Check whether signature is in header | ||
const checkFunctions = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's declare this outside the function :)
Two little documentations nits for me. Good job otherwise. |
Updated, the commits will be squash and clean after all comments addressed |
👍 once the lint errors are solved. |
d6ae49d
to
2b1c8a9
Compare
Updated, I removed lib/auth/vault.js and the associated tests |
10077a7
to
776b6a3
Compare
@ironman-machine Please validate this step :d (Yes I know, this is kinda new and shiny, and I wanted to play with it first !) 🎱 |
Hello @DavidPineauScality, Starting end to end procedure using the following payload: Please follow http://ci.ironmann.io/gh/scality/Integration/2827 for circle status. |
@ironman-machine Please check (rebase still needed) |
Hello @DavidPineauScality, Starting end to end procedure using the following payload: Please follow http://ci.ironmann.io/gh/scality/Integration/3046 for circle status. |
776b6a3
to
0727fae
Compare
@ironman-machine You will work, i know that :) |
Hello @alexandre-merle, Starting end to end procedure using the following payload: Please follow http://ci.ironmann.io/gh/scality/Integration/3055 for circle status. |
0727fae
to
8176bd4
Compare
@ironman-machine Please, tell me i'm not wrong about rebase :D |
Hello @alexandre-merle, Starting end to end procedure using the following payload: Please follow http://ci.ironmann.io/gh/scality/Integration/3799 for circle status. |
@ironman-machine let's try again ^^ SCALITY_INTEGRATION_BRANCH=fix/nimrod-build-dep |
7f1c46d
to
974bf57
Compare
Hello @alexandre-merle, Starting end to end procedure using the following payload: Please follow http://ci.ironmann.io/gh/scality/Integration/4016 for circle status. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question: Was that test removal necessary? I'd rather not see the coverage fall further behind.
Provides the following: - Reduces redundancy by removing known information from module and function names - Simplifies the way the check functions are exported in either auth scheme - Rework the code flow in checkSignature: - Now easier to follow (logic now appears through the code as a two-step operation) - Improved logging (now only provides a few common messages with variable parameters)
- Renames checkSignature into extractParams, as this function mostly extracts the parameters from either the headers or the querystring to identify what kind of auth to use - Renames the data field of the returned data by extractParams into 'params', as those are the real parameters for the signature check function that will soon be extracted from the auth code. - Simplifies the doAuth function as a first step towards its disappearance
- with the refactor of auth API we can now remove unused files * lib/auth/vault.js * tests/unit/auth/v2/errorHandling.js
974bf57
to
87a86ec
Compare
@Michael-Zapata it's mostly due to the fact that my aim is to end with the removal of the doAuth function, so the associated tests are no longer relevant. That being said, other tests are still relying on it, so I'll try restoring the tests. |
Also, please note that the removed tests were relying on the unused vault.js wrapper that was deleted alongside. |
Merging on behalf of @rahulreddy since we need to merge the PRs in order (and in sync): |
First step towards #102
This PR provides the following improvements: