Skip to content

Endorsement Store Interface Implementation - #435

Open
shefali-kamal wants to merge 9 commits into
veraison:mainfrom
MonakaResearch:main
Open

Endorsement Store Interface Implementation#435
shefali-kamal wants to merge 9 commits into
veraison:mainfrom
MonakaResearch:main

Conversation

@shefali-kamal

Copy link
Copy Markdown

This PR implements following:

  • contains the implementation of endorsement store plugin interface
  • converted coserv proxy plugins to endorsement store plugins
  • make changes in vts to use the endorsement store plugins
  • vts now uses a composite store made up of corimstore and store plugins as fallback

Address issue #431

DhanusML added 9 commits July 31, 2026 12:09
Definition of protobuf messages used as arguments for
endorsement store interface.

Signed-off-by: Dhanus M Lal <Dhanus.MLal@fujitsu.com>
The store plugin interface definition and implementation
of the RPC layer (for go-plugin client and server).
Endorsement store interface is an aggregation of
IEndorsementStoreReader and IEndorsementStoreWriter, for
read and write operations on endorsement store respectively.

Signed-off-by: Dhanus M Lal <Dhanus.MLal@fujitsu.com>
Register endorsementstore targets in the build system
and docker deployment.

Signed-off-by: Dhanus M Lal <Dhanus.MLal@fujitsu.com>
The coserv proxy plugins are now store plugins,
with only the ExecuteCoservQuery method implemented.

Note: builtin loader may not work.

Note: the new stores (amd and nvidia) have not been tested yet.

Signed-off-by: Dhanus M Lal <Dhanus.MLal@fujitsu.com>
Add corimstore based store plugin. The implementation
converts existing store implementation into a plugin.

Signed-off-by: Dhanus M Lal <Dhanus.MLal@fujitsu.com>
Update VTS to use the IEndorsementStore interface.

Signed-off-by: Dhanus M Lal <Dhanus.MLal@fujitsu.com>
q -> %q

Signed-off-by: Dhanus M Lal <Dhanus.MLal@fujitsu.com>
Signed-off-by: Dhanus M Lal <Dhanus.MLal@fujitsu.com>
Signed-off-by: Dhanus M Lal <Dhanus.MLal@fujitsu.com>

@setrofim setrofim left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't think the notion of a "media type" makes sense in the context of the store backend. We don't really want to be selecting the backend based on it. I also don't like the somewhat arbitrary distinction between "primary" and "fallback" backends.

Suggestion: store backends are identified solely by name; for the sake of reusing existing plugin loader/manager the media type APIs implemented via a shim to to just return the name, and this is hidden as much as possible. Store configuration contains a list of backend names, which specifies which frontend plugins will actually be actively used by the store frontend. When servicing requests, the frontend tries the backends in the order specified until.


func NewStore() *DefaultStore {
logger := log.Named(PluginName)
logger.Debug("initializing default store")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This log line belongs inside DefaultStore.Init() below, not here.


func (s *DefaultStore) Init(params *plugin.Parameters) error {
if params == nil {
panic("parameters are required for corimstore")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Return an error rather than panic here.


store, err := corimstore.Open(context.Background(), cfg.StoreConfig())
if err != nil {
panic(err)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Return the error rather than panic.

// initialize it here.
if strings.Contains(cfg.DSN, ":memory:") {
if err := store.Init(); err != nil {
panic(err)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Return the error rather than panic.

return SchemeName
}

func (s *DefaultStore) GetSupportedMediaTypes() map[string][]string {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't think the concept of a "supported media type" really makes sense for a store backend. I think we may want a different plugin interface for this.

return res, err
}

func (s *DefaultStore) ExecuteCoservQuery(mediaType, query string) (*coserv.Coserv, error) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why does this take a mediaType? It does not appear to be used, and also clashes with remaining store API that takea label instead. The media type should be resolved to a label by the time the request reaches the store.

}

func (s CoservProxyHandler) GetEndorsements(tenantID string, query string) ([]byte, error) {
func (s CoservProxyHandler) ExecuteCoservQuery(mediaType, query string) (*coserv.Coserv, error) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ditto here. the media type should be resolved by this point.

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.

3 participants