Support for dynamic declaration storage #91
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds support for dynamic declarations via interfaces and adapters over declaration storage.
The three declaration interface methods,
RetrieveTokensJSON()
,RetrieveDeclarationItemsJSON()
, andRetrieveEnrollmentDeclarationJSON()
are the primary ways by which declarations, declaration items, and tokens are served to clients. We introduce aNewJSONAdapt()
service which can dynamically supply declaration items and tokens using a new storage interface method,RetrieveDeclarationItems()
.This new interface opens the possibility of composing multiple sets of declarations into a single declaration items. And we do just that with the
NewMulti()
service which composes multiple declaration storages using "fall-through" to provide a unified "view" of declarations to an enrollment.Included is an implementation of a "shard" declaration storage. This is combined with the normal backend storage (using the
-shard
switch to the server) to be simultaneously served with the persisted declarations from disk or database. From the docs:Also some other minor changes:
ddm
packagesqlc
to MySQL backend (though, not fully convert over yet)