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

Make --secret override project config #308

Merged
merged 5 commits into from
Oct 16, 2023
Merged

Conversation

macmv
Copy link
Contributor

@macmv macmv commented Oct 13, 2023

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 :)

@macmv macmv requested a review from fauna-chase October 13, 2023 19:10
Comment on lines +19 to 26
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) {
Copy link
Contributor

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.

Comment on lines 30 to 32
if (key.includes(":")) {
throw new Error("Secret cannot be scoped");
}
Copy link
Contributor

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.

@fauna-chase fauna-chase merged commit a129876 into main Oct 16, 2023
@fauna-chase fauna-chase deleted the secret-overrides-project branch October 16, 2023 21:29
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