minder icon indicating copy to clipboard operation
minder copied to clipboard

Extend the GitHub App configuration with an autoRegistration object

Open jhrozek opened this issue 1 year ago • 0 comments

To enable configuring auto-registration of entities (repositories for a start) we need to extend the configuration of the GitHub App provider which is currently quite bare-bones:

message GitHubAppProviderConfig {
 // Endpoint is the GitHub API endpoint. If using the public GitHub API, Endpoint can be left blank.
 string endpoint = 1;
}

// and then in Go code
func ParseV1Config(rawCfg json.RawMessage) (*minderv1.GitHubAppProviderConfig, error) {

to let the user configure the auto registration configuration:

message AutoRegistration {
	 // There is no difference between intentionally unset and undefined so for the "let's not auto-register anything" case we'd just let the repeated Entity empty
	repeated Entity enabled = 1;
}

message GitHubAppProviderConfig {
 // Endpoint is the GitHub API endpoint. If using the public GitHub API, Endpoint can be left blank.
 string endpoint = 1;
}

message ProviderConfig {
 	AutoRegistration auto_registration = 1;
	google.protobuf.Struct config = 2;
}

func ParseV1Config(rawCfg json.RawMessage) (*minderv1.ProviderConfig, error) {
type wrapper struct {
   GitHub *minderv1.GitHubProviderConfig `json:"github" yaml:"github" mapstructure:"github" validate:"required"`
}

jhrozek avatar May 07 '24 14:05 jhrozek