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

transitional approach to OCap Discipline #10038

Open
dckc opened this issue Sep 6, 2024 · 0 comments
Open

transitional approach to OCap Discipline #10038

dckc opened this issue Sep 6, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@dckc
Copy link
Member

dckc commented Sep 6, 2024

in progress

What is the Problem Being Solved?

Description of the Design

Allow default args to bind to ambient authority, but always let the caller override them.

example sketch:

import dbOpenAmbient from 'better-sqlite3';

const getVatDetails = (misc, args, io = {}) {
  const {
    dbOpen = dbOpenAmbient,
    env = process.env,
    HOME = env.HOME,
    fullPath = swingStorePath.replace(/^~/, HOME),
    db = dbOpen(fullPath)
 } = io;
 ... use db ...
}

That way, a caller can just pass in the db, or they can pass in env or HOME, or a mock dbOpen implementation, etc. etc.

Security Considerations

Scaling Considerations

Test Plan

Upgrade Considerations

A goal would be to remove the ambient authority completely, in due course, but that would be a breaking change. Hope to think this thru a bit more...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant