-
Notifications
You must be signed in to change notification settings - Fork 66
dlog v1 finalization: enforce at least one issuer #1010
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
Conversation
Signed-off-by: Angelo De Caro <angelo.decaro@gmail.com>
Signed-off-by: Angelo De Caro <angelo.decaro@gmail.com>
Signed-off-by: Angelo De Caro <angelo.decaro@gmail.com>
update public params during test when needed LocalMembership should not discard identities not in the target list, just assign a low priority Signed-off-by: Angelo De Caro <angelo.decaro@gmail.com>
Signed-off-by: Angelo De Caro <angelo.decaro@gmail.com>
Signed-off-by: Angelo De Caro <angelo.decaro@gmail.com>
Signed-off-by: Angelo De Caro <angelo.decaro@gmail.com>
Signed-off-by: Angelo De Caro <angelo.decaro@gmail.com>
Signed-off-by: Angelo De Caro <angelo.decaro@gmail.com>
Signed-off-by: Angelo De Caro <angelo.decaro@gmail.com>
Signed-off-by: Angelo De Caro <angelo.decaro@gmail.com>
Signed-off-by: Angelo De Caro <angelo.decaro@gmail.com>
Signed-off-by: Angelo De Caro <angelo.decaro@gmail.com>
Signed-off-by: Angelo De Caro <angelo.decaro@gmail.com>
Signed-off-by: Angelo De Caro <angelo.decaro@gmail.com>
Signed-off-by: Angelo De Caro <angelo.decaro@gmail.com>
Signed-off-by: Angelo De Caro <angelo.decaro@gmail.com>
Signed-off-by: Angelo De Caro <angelo.decaro@gmail.com>
Signed-off-by: Angelo De Caro <angelo.decaro@gmail.com>
Signed-off-by: Angelo De Caro <angelo.decaro@gmail.com>
| func PrepareUpdatedPublicParams(network *integration.Infrastructure, auditor string, networkName string) []byte { | ||
| tms := GetTMSByNetworkName(network, networkName) | ||
| auditorId := GetAuditorIdentity(tms, auditor) | ||
| issuerId := GetIssuerIdentity(tms, "newIssuer") |
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.
Gives a bit more clarity if we pass the issuer id as a parameter too.
| // log information about the public params | ||
| pp := publicParamsManager.PublicParams() | ||
| logger.Infof("new token driver for tms id [%s] with label and version [%s:%s]", tmsID, pp.Identifier(), pp.Version()) | ||
| for _, issuer := range pp.Issuers() { |
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.
You can do
logger.Debug("issuers are [%s]", pp.Issuers())
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.
I wanted to have them on separated lines, for clarify.
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.
removed, I'll just print the public params.
| "--issuers", "Error: failed to generate public parameters: failed to get issuer identity [aOrg1MSP]: invalid input [aOrg1MSP]", | ||
| }, | ||
| ErrMsg: "Error: failed to generate public parameters: failed to get issuer identity [Error: failed to generate public parameters: failed to get issuer identity [aOrg1MSP]: invalid input [aOrg1MSP]]:", | ||
| ErrMsg: "Error: failed to generate public parameters: failed to setup issuer and auditors: failed to get issuer identity [Error: failed to generate public parameters: failed to get issuer identity [aOrg1MSP]: invalid input [aOrg1MSP]]: failed to load certificates from Error: failed to generate public parameters: failed to get issuer identity [aOrg1MSP]: invalid input [aOrg1MSP]/signcerts: stat Error: failed to generate public parameters: failed to get issuer identity [aOrg1MSP]: invalid input [aOrg1MSP]/signcerts: no such file or directory", |
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.
typo: "failed to load certificates from Error"
| type OnRestartFunc = func(*integration.Infrastructure, string) | ||
|
|
||
| func TestAll(network *integration.Infrastructure, auditorId string, onRestart OnRestartFunc, aries bool, sel *token3.ReplicaSelector) { | ||
| func TestAll(network *integration.Infrastructure, auditorId string, onRestart OnRestartFunc, aries bool, orion bool, sel *token3.ReplicaSelector) { |
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.
consider, instead of "aries", "orion", and more possible future system-specific parameter names, maybe use a single generic parameter like network_name.
|
|
||
| SetKVSEntry(network, issuer, "auditor", auditor.Id()) | ||
| CheckPublicParams(network, issuer, auditor, alice, bob, charlie, manager) | ||
| if orion { |
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.
consider, instead of mentioning a specific network_name in the code, maybe refer to its relevant trait. Then, either pass the trait as a parameter or maintain a structure with generic traits for every network type.
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.
good point, I think we need to rework these tests. I'll open a github issue for it.
| // log information about the public params | ||
| pp := publicParamsManager.PublicParams() | ||
| logger.Infof("new token driver for tms id [%s] with label and version [%s:%s]", tmsID, pp.Identifier(), pp.Version()) | ||
| for _, issuer := range pp.Issuers() { |
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.
I see that this kind of debug-printing occurs often in the code.
Consider having a general debug-printing method for printing slices of strings - e.g. something like logger.logSliceOf("issuer", pp.Issuers())
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.
cleaned
| l.logger.Debugf("identity [%s:%s] not in target identities", name, config.URL) | ||
| } else { | ||
| // give it high priority | ||
| priority = -1 |
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 could have it as a constant or even better a type to explain whether a low or high number has higher priority
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.
done
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.
LGTM modulo comments
Signed-off-by: Angelo De Caro <angelo.decaro@gmail.com>
We start by adding the check that at least one issuer identity is specified in the
Validatefunction of the public parameters. From there, we make sure the rest still works.Many of the integration tests were assuming that anyone could issue, therefore we had to change the test to update the public parameters with the identities of who needed to issue.