-
Notifications
You must be signed in to change notification settings - Fork 6
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
Implementation of simple consent #53
Conversation
@@ -2,6 +2,38 @@ | |||
This module implements Humbug's user consent mechanisms. | |||
*/ | |||
|
|||
type Yes = "1" | "t" | "y" | "T" | "Y" | "true" | "yes" | "True" | "Yes" | "TRUE" | "YES" |
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.
We should still have these.
javascript/src/consent.ts
Outdated
} | ||
} | ||
|
||
function environmentVariableOptOut(): boolean { |
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.
BUGGER_OFF=true
is not for libraries integrating with humbug, it is for the end user.
If someone who is using humbug
in their library wants to have environmentVariableOptOut
, we should implement similiarly as in humbug/python
.
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 instead be like this:
function environmentVariableOptOut(envVar: string, optOutValues: Array<string>): func():bool {
return func(): bool {
const envVal = process.env[envVar];
return optOutValues.includes(envVal);
}
}
} | ||
|
||
check(): boolean { | ||
if (this.mechanisms === false) { |
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.
if (Yes.includes(process.env.BUGGER_OFF)) {
return false;
}
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.
lgtm
No description provided.