-
Notifications
You must be signed in to change notification settings - Fork 102
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
Namespaced Keysets #1011
Namespaced Keysets #1011
Conversation
This comment was marked as off-topic.
This comment was marked as off-topic.
@michaeldoron59 please comment on the issue and not the PR. |
…nto feat/namespaced-keysets
-- enforce the user guard and make sure we have privs | ||
enforceGuard i ug | ||
pure k | ||
_ -> evalError' fi "Mismatching keyset namespaces") |
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.
The error here could be a bit better. If KeySetName
does not parse a Namespace
, we're just going to fail because it's not namespaced.
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.
Sure i could improve this
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.
A more meaningful error message would be helpful, especially as most documents use the DisablePact44
behavior. Additionally, shouldn't the current namespace, if set, be enough? I.e.,
(namespace 'free)
(define-keyset "robert" ....
define the keyset implicitly as "free.robert"
?
} deriving (Eq, Ord, Show, Generic) | ||
|
||
instance IsString KeySetName where | ||
fromString ksn = case parseAnyKeysetName (T.pack ksn) of |
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.
Is this instance only for tests? This is such a strange instance.
really need to check all usages of fromString
with this.
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.
We can actually do without this and I"d be happy. IsString
at least fails if it doesn't pass the parser test.
@@ -160,10 +160,11 @@ principalParser (getInfo -> i) = kParser | |||
guardToPrincipal :: Guard (Term Name) -> Eval e Principal | |||
guardToPrincipal = \case | |||
GPact (PactGuard pid n) -> pure $ P pid n | |||
-- TODO later: revisit structure of principal k and w accounts in light of namespaces |
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.
Need to address this: Do we change the principal of the keyset ref guard?
See: #351