A credential has a required flag, which defaults to true. As #108 and the spec point out:
required indicates whether this credential MUST be supplied. By default it is false, which means the credential is optional. When true, a runtime MUST fail if the credential is not provided.
However, we were ALWAYS requiring any credential to have a value provided. This check occurred both in the CredentialSet Validate(..) method for that is used for stateful actions, but also the Expand(...) method. The Expand(..) method had an argument to flag an call to the method as stateless, in which case we allowed a credential to not be present but we still failed on optional for stateful calls.
This PR adds explicit handling for optional credentials.
A credential has a
required
flag, which defaults totrue
. As #108 and the spec point out:However, we were ALWAYS requiring any credential to have a value provided. This check occurred both in the CredentialSet Validate(..) method for that is used for stateful actions, but also the Expand(...) method. The Expand(..) method had an argument to flag an call to the method as stateless, in which case we allowed a credential to not be present but we still failed on optional for stateful calls.
This PR adds explicit handling for optional credentials.
Fixes #108