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

Client-Auth files #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Client-Auth files #21

wants to merge 1 commit into from

Conversation

anjuthomas
Copy link
Contributor

No description provided.

@anjuthomas anjuthomas requested a review from haamel May 29, 2018 08:30
* client info.
*/

const OICCli = require('../init.js').OICCli;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused constant. Please remove for now.

*/

const OICCli = require('../init.js').OICCli;
const utf8 = require('utf8');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused constant. Please remove for now.


const OICCli = require('../init.js').OICCli;
const utf8 = require('utf8');
const base64url = require('base64url');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused constant. Please remove for now.

}
}

function validServiceContext(serviceContext, when) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name of this function and what it does is not really intuitive. At first I thought it will give a valid ServiceContext object, but when I looked at the code it's checking whether client_secret_expires_at is set and still before the given time.

How about changing the name into something more meaningful? E.g. isValidServiceContext or isServiceContextValid?

It also might make sense to move this function into the ServiceContext class or is there a reason to have it here?

}

function validServiceContext(serviceContext, when) {
let eta = serviceContext['client_secret_expires_at'] || 0;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to have client_secret_expires_at defined as a member in ServiceContext, and access it like `serviceContext.client_secret_expires_at? Or is there a reason to access it like it is now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants