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

Extend the GitHub App configuration with an autoRegistration object #3266

Open
jhrozek opened this issue May 7, 2024 · 0 comments
Open

Extend the GitHub App configuration with an autoRegistration object #3266

jhrozek opened this issue May 7, 2024 · 0 comments

Comments

@jhrozek
Copy link
Contributor

jhrozek commented May 7, 2024

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"`
}
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

No branches or pull requests

1 participant