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

Implementation Review PR #3

Closed
wants to merge 44 commits into from
Closed

Implementation Review PR #3

wants to merge 44 commits into from

Conversation

flea89
Copy link
Contributor

@flea89 flea89 commented Mar 4, 2022

Created this PR to capture initial feedback on UCAN library implementation

@flea89 flea89 self-assigned this Mar 4, 2022
spec.md Show resolved Hide resolved
spec.md Show resolved Hide resolved
src/index.js Outdated Show resolved Hide resolved
src/ucan.js Show resolved Hide resolved
@adamalton
Copy link
Contributor

adamalton commented Mar 8, 2022

I've read through all of this, and it all looks great. I just have one suggestion (which may already be in the pipeline), which is that the logic in semantics.js could probably be made generic for any set of hierarchical actions. So it could be turned into something where maybe instead of a storageSemantics class, there could just be a generic semantics class. So you'd have:

const storageActions = {
  'upload/': {
    '*': {
      'IMPORT',
    }
  }
}

And then you could pass that into the generic semantics class like:

const storageSemantics = sematics(storageActions);

and the tryParsing and tryDelegating methods (and therefore that whole class) then become completely generic and can be used for other cases as well.

You've probably already thought of this, but it's my main suggestion for improvement at the mo.

@adamalton
Copy link
Contributor

I've just read the documentation additions to the README, which look great. Reading that, it's given me a thought, which is that it would be nice to allow the CLI commands to accept the private key as a path to a file, so that (1) the user doesn't have to go through the step of copying the value out of their private key file, and (2) their private key isn't stored in their shell history.

So, e.g. ucan-storage keypair --from <private-key> could have an alternative usage of ucan-storage keypair --from-file <path-to-private-key-file>.
and similarly ucan-storage ucan --issuer <your-private-key> could have an alternative usage of ucan-storage ucan --issuer-file <path-to-your-private-key>.

The user could just pass the key file contents as an argument themselves using some shell trickery. And there's also the complication that if we implement it then we have to consider the possibility of the key file being encrypted. So maybe it's not worth it. But it might be nice to have this option as a convenience and to encourage a more secure usage.

@hugomrdias
Copy link
Contributor

I've just read the documentation additions to the README, which look great. Reading that, it's given me a thought, which is that it would be nice to allow the CLI commands to accept the private key as a path to a file, so that (1) the user doesn't have to go through the step of copying the value out of their private key file, and (2) their private key isn't stored in their shell history.

So, e.g. ucan-storage keypair --from <private-key> could have an alternative usage of ucan-storage keypair --from-file <path-to-private-key-file>. and similarly ucan-storage ucan --issuer <your-private-key> could have an alternative usage of ucan-storage ucan --issuer-file <path-to-your-private-key>.

The user could just pass the key file contents as an argument themselves using some shell trickery. And there's also the complication that if we implement it then we have to consider the possibility of the key file being encrypted. So maybe it's not worth it. But it might be nice to have this option as a convenience and to encourage a more secure usage.

already made an issue about this please check it out and add feedback there #11

hugomrdias and others added 21 commits March 10, 2022 17:26
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@flea89 flea89 closed this Aug 1, 2022
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.

None yet

8 participants