fix: use enum for instance feature in system api (#6682)

* fix: use enum for instance feature in system api

* add feature.proto to lint ignore
This commit is contained in:
Livio Spring 2023-10-09 13:33:23 +03:00 committed by GitHub
parent 9696fde676
commit 827ce8809d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 2 deletions

View File

@ -19,6 +19,7 @@ lint:
- zitadel/auth.proto
- zitadel/change.proto
- zitadel/event.proto
- zitadel/feature.proto
- zitadel/idp.proto
- zitadel/instance.proto
- zitadel/management.proto

View File

@ -0,0 +1,10 @@
syntax = "proto3";
package zitadel.feature.v1;
option go_package ="github.com/zitadel/zitadel/pkg/grpc/feature";
enum InstanceFeature {
INSTANCE_FEATURE_UNSPECIFIED = 0;
INSTANCE_FEATURE_LOGIN_DEFAULT_ORG = 1;
}

View File

@ -6,6 +6,7 @@ import "zitadel/instance.proto";
import "zitadel/member.proto";
import "zitadel/quota.proto";
import "zitadel/auth_n_key.proto";
import "zitadel/feature.proto";
import "google/api/annotations.proto";
import "google/protobuf/timestamp.proto";
@ -894,8 +895,7 @@ message FailedEvent {
message SetInstanceFeatureRequest {
string instance_id = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
// the feature (id) according to [internal/domain/feature.go]
int32 feature_id = 2 [(validate.rules).int32 = {gt: 0}];
zitadel.feature.v1.InstanceFeature feature_id = 2 [(validate.rules).enum = {not_in: 0, defined_only: true}];
// value based on the feature type
oneof value {
option (validate.required) = true;