Skip to content

[Feature] Add support for adding plugin details in client generator #1690

@YourTechBud

Description

@YourTechBud

The problem faced currently?

The worker sdk needs to manually provider the plugin details they wish to apply to their handlers. This leads to typos

How can we solve it?

  • spacectl client generate command will fetch the list of plugins from SC (Ref: [Feature] Add endpoint to return a list of available plugins. #1689)
  • Each driver to implement a method named GeneratePlugins()
  • The output of GeneratePlugins() will be an exposed struct named Plugins with a member function for each plugin registered in SC.
    • The member function will be named as `<upperCamelCase(driver)><upperCamelCase(name)>
    • Example: if driver=opa; name=is-admin then name of function will be OpaIsAdmin()
    • Each function will return a struct named PluginDetails which implements a PluginImpl interface. This interface will have 3 methods:
      • Name() -> name of plugin
      • Driver() -> driver of plugin
      • Params() -> type any (will always be nil for now)
  • The output of this will be in a separate file named plugins.go
  • We want this support only for the golang and typescript drivers

If you want this feature to be implemented, give it a thumbs up reaction, so that we can determine which features are important to you.
👍

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

👀 In review

Relationships

None yet

Development

No branches or pull requests

Issue actions