minder
minder copied to clipboard
Add a mechanism to patch provider configuration post enrollment
This is a follow-up to issue #3263. In addition to storing the provider configuration on provider creation we'll also want to patch the provider configuration after the fact. We might want to implement something like:
message ProviderPatch {
// to allow generic configuration changes.
google.protobuf.Struct config = 1;
}
message PatchProviderRequest {
Context context = 1;
ProviderPatch = 2;
google.protobuf.FieldMask update_mask = 3;
}
message PatchProviderResponse {
Provider provider = 1;
}
rpc PatchProvider(PatchProviderRequest) returns (PatchProviderResponse) {
option (google.api.http) {
patch: "/api/v1/provider"
body: "patch"
}
option (rpc_options) = {
target_resource = TARGET_RESOURCE_PROJECT;
relation = RELATION_PROVIDER_UPDATE;
}
}
and expose that through the CLI. To implement the patch handler we'll need to:
- Extend the ProviderManager interface with a new PatchProvider method, e.g PatchProvider(ctx context.Context, uuid uuid.UUID, patch minderv1.ProviderPatch) (minderv1.Provider, error)
- Extend the ProviderClassManager interface with a new Patch method
- The ProviderManager.PatchProvider would get the correct class manager and call its Patch
- The per-provider Patch implementation is where the generic protobuf struct is unmarshalled into the correct Go struct and the configuration adjusted