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

Need to thread configuration data through to lockdown #578

Closed
erights opened this issue Feb 19, 2021 · 8 comments · Fixed by Agoric/agoric-sdk#2757
Closed

Need to thread configuration data through to lockdown #578

erights opened this issue Feb 19, 2021 · 8 comments · Fixed by Agoric/agoric-sdk#2757
Assignees

Comments

@erights
Copy link
Contributor

erights commented Feb 19, 2021

See #488 for one of the uses that would benefit.

@dckc
Copy link
Contributor

dckc commented Mar 2, 2021

I'm manually editing install-ses.js to change stackFiltering to verbose. There has to be a better way. Is this a time and place for environment variables? hm.

@erights writes:

Yes, we need to figure out some way to provide lockdown parameters as data somehow, other than by editing code. We also need lockdown to accept configuration data rather than just named choices as these parameters. Environment variables are on the table as a candidate, which shows just how desperately we need this :/

@erights
Copy link
Contributor Author

erights commented Mar 7, 2021

@FUDCo
Copy link
Contributor

FUDCo commented Mar 16, 2021

@erights inquired on keybase how one might do this without resorting to environment variables.

My take is that the primary use case for needing this is tests, which may be a special case but it's a very important, very common case whose actual needs are simple.

Tests know that they're tests and that (1) things go wrong in tests so we should be prepared to be maximally helpful when that happens, and (2) tests aren't usually a place where we care much about security rigor (except, of course, for tests that are testing the security rigor itself, but that's mostly not what we're dealing with here).

In tests, for a control affordance I would kind of like to just replace import test from 'ava'; with import test from '@agoric/something';

Alternatively, replace import '@agoric/install-ses'; with import '@agoric/install-somethingelse'; where somethingelse understands that it's being incorporated into a test environment.

Since there's already standard boilerplate at the top of each test file, it's not a particular burden to have to modify that boilerplate into something else, as long as there's a convenient something else available to modify it to.

@dckc
Copy link
Contributor

dckc commented Mar 16, 2021

... Alternatively, replace import '@agoric/install-ses'; with import '@agoric/install-somethingelse'; where somethingelse understands that it's being incorporated into a test environment.

The other day we were chatting bout this as an enhancement to #2571 :

import test from '@agoric/swingset-vat/tools/prepare-test-env';

for reference...

https://github.com/Agoric/agoric-sdk/blob/master/packages/SwingSet/test/test-comms.js

https://github.com/Agoric/agoric-sdk/blob/master/packages/SwingSet/tools/prepare-test-env.js

@kumavis
Copy link
Member

kumavis commented Apr 12, 2021

ill just add that you can use esm query params to import a parameterized package and im sure its a marvelous foot gun that doesnt actually solve this problem

@dckc
Copy link
Contributor

dckc commented Apr 12, 2021

esm query params... pointer to details? A quick search didn't find much.

I don't think it helps in our use case (changing parameters without changing references to the package / module) but it seems interesting for cases when the reference can change.

@kumavis
Copy link
Member

kumavis commented Apr 20, 2021

@dckc import xyz from './abc.js?didYouKnow=false&thatYouCanDoThis=true' and then read in import.meta

@dckc
Copy link
Contributor

dckc commented Apr 20, 2021

ah. so just inspection of import.meta.url.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import.meta

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 a pull request may close this issue.

4 participants