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

Further cleanup of namespace params to managers and database plugin #864

Merged
merged 12 commits into from
Jun 20, 2022

Conversation

awrichar
Copy link
Contributor

@awrichar awrichar commented Jun 15, 2022

Part of FIR-12
In a chain with #862

Each manager is specific to a namespace, which should be received and stored during init. All operations conducted by that manager should use that namespace, and therefore no manager methods should accept a namespace as a parameter.

The database plugin, on the other hand, may potentially service multiple namespaces. Therefore, all query operations should take a namespace parameter to ensure that only results from a single namespace are returned.

This PR makes these true for many cases, but others are still to be addressed with a follow-up PR.

awrichar added 12 commits June 14, 2022 15:05
The manager is initialized for a single namespace and can assume all calls
are scoped within that namespace.

The one exception is for "network version 1", where identities may have been
registered on the legacy "ff_system" namespace. In this case, the identity
manager will query "ff_system" instead of its assigned namespace (noting that
this will only work if "ff_system" shares a database with that namespace).

Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
Also add namespace as a param to all database queries on identities,
verifiers, and groups.

Switch group manager to go via identity manager for identity lookups,
instead of going directly to the database (to preserve fallback
resolutions on ff_system).

Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
Also remove namespace from txcommon params and some orchestrator queries,
as they are already bound to a single namespace.

Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
Also remove it from some related messaging/token methods.

Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
Copy link
Contributor

@peterbroadhurst peterbroadhurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed all the changes in the commits after #862 👍 (looks like Git is happy to work out the merge)

@peterbroadhurst peterbroadhurst merged commit 8750d27 into hyperledger:main Jun 20, 2022
@peterbroadhurst peterbroadhurst deleted the queries branch June 20, 2022 13:18
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.

2 participants