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

Impersonation in E2E #704

Merged
merged 2 commits into from
Jan 17, 2025
Merged

Impersonation in E2E #704

merged 2 commits into from
Jan 17, 2025

Conversation

danielattilasimon
Copy link
Collaborator

No description provided.

@danielattilasimon danielattilasimon changed the title Impersonate Impersonation in E2E Jan 17, 2025
@danielattilasimon danielattilasimon merged commit 712bd2c into main Jan 17, 2025
8 checks passed
Copy link
Collaborator

@bingen bingen left a comment

Choose a reason for hiding this comment

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

Looks good to me, but maybe we can revisit that overlap between env and argument booleans.

options.debug ??= Boolean(
process.env.DEBUG && process.env.DEBUG !== "false",
);
options.debug ||= envBool("DEBUG");
Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess I’m missing something, but this seems like a weird behaviour to me:

  • If env var DEBUG is not set, then argument --debug will be used -> fine
  • If env var DEBUG is set to “false” or “no”, then argument --debug will be used -> ??
  • If env var DEBUG is set to “true” or “yes”, then env var will be used -> ??

It seem inconsistent to me.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I see your point, but it's not so easy. The previous behavior was completely broken, because ??= only has an effect on nullish values, but the way we've configured minimist, it returns false when a bool argument such as --debug is missing. Thus, it was impossible to enable debugging via the environment. In that sense, this is already an improvement.

The problem is this:

Note: options can also be set via corresponding environment variables,
e.g. --chain-id can be set via CHAIN_ID instead. Parameters take precedence over variables.

"Parameters take precedence" over variables, but a parameter declared boolean in minimist options is set to false by being omitted. So currently, there's no way to tell the difference between no --debug option being passed or explicitly passing e.g. --debug=false.

I guess we could remove the list of boolean options from the minimist config altogether, and do our own parsing...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

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