-
Notifications
You must be signed in to change notification settings - Fork 16
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
Make --secret override project config #308
Conversation
static parseFlag(key: string) { | ||
if (key.length === 0) { | ||
throw new Error("Secret cannot be empty"); | ||
} | ||
return new Secret({ key, allowDatabase: !key.includes(":") }); | ||
} | ||
|
||
static parse(key: string) { |
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.
wondering if we should just have one parse method, could take as a parameter whether or not the key can be scoped. Could use both of these methods under the hood. looking at 2 methods parse vs parseFlag may not be clear which to use but if we had an explicit parameter, allowScopedKey
or something, then it may make it a bit more clear.
if (key.includes(":")) { | ||
throw new Error("Secret cannot be scoped"); | ||
} |
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.
my understanding here is that we wouldn't allow scoped secrets in the .fauna-shell
file. I think that is fine, is backwards incompatible I believe though so could be a good thing for us to be aware of.
Ticket(s): ENG-5650
I think this matches the feature matrix. I added some tests, and validated manually. We don't have mocks for the root/project config up, so I wasn't able to test all the combinations of things, but I'm mostly confident that its right :)