some cleanup

This commit is contained in:
Livio Spring
2025-02-10 11:30:23 +01:00
parent 0efb4769cf
commit d8ca1420f9
3 changed files with 110 additions and 103 deletions

View File

@@ -4,8 +4,8 @@ package zitadel.authorizations.v2;
import "google/protobuf/timestamp.proto";
import "validate/validate.proto";
import "zitadel/object/v2/object.proto";
import "zitadel/authorizations/v2/authorization.proto";
import "zitadel/object/v2/object.proto";
option go_package = "github.com/zitadel/zitadel/pkg/grpc/authorizations/v2;authorizations";

View File

@@ -1,30 +1,37 @@
syntax = "proto3";
import "zitadel/object.proto";
import "validate/validate.proto";
package zitadel.metadata.v2;
option go_package ="github.com/zitadel/zitadel/pkg/grpc/metadata/v2";
import "google/protobuf/timestamp.proto";
import "validate/validate.proto";
import "zitadel/object.proto";
option go_package = "github.com/zitadel/zitadel/pkg/grpc/metadata/v2;metadata";
message Metadata {
//zitadel.v1.ObjectDetails details = 1; TODO?
string key = 2;
bytes value = 3;
// Timestamp of the creation of the metadata.
google.protobuf.Timestamp creation_date = 1;
// Timestamp of the last change of the metadata.
// In case the metadata was not changed, this field is equal to the creation date.
google.protobuf.Timestamp change_date = 2;
// Key of the metadata. This is the unique identifier of the metadata.
string key = 3;
// Value of the metadata.
bytes value = 4;
}
message MetadataQuery {
oneof query {
option (validate.required) = true;
MetadataKeyQuery key_query = 1;
}
oneof query {
option (validate.required) = true;
MetadataKeyQuery key_query = 1;
}
}
message MetadataKeyQuery {
string key = 1 [
(validate.rules).string = {max_len: 200}
];
zitadel.v1.TextQueryMethod method = 2 [
(validate.rules).enum.defined_only = true
];
// Specify the the key of the metadata to search for.
string key = 1 [(validate.rules).string = {max_len: 200}];
// Specify the method to use for the search. Default is EQUALS.
// For example, if you want to search for a key that starts with a specific string,
// use STARTS_WITH or STARTS_WITH_IGNORE_CASE.
zitadel.v1.TextQueryMethod method = 2 [(validate.rules).enum.defined_only = true];
}

View File

@@ -1285,91 +1285,6 @@ service UserService {
rpc RemoveMetadata (RemoveMetadataRequest) returns (RemoveMetadataResponse) {}
}
message ListMetadataRequest{
// The user ID of the user you like to get the metadata from.
string user_id = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
// Paginate through the results using a limit.
zitadel.object.v2.ListQuery query = 2;
// Filter the metadata to be returned.
repeated zitadel.metadata.v2.MetadataQuery queries = 3;
}
message ListMetadataResponse{
zitadel.object.v2.ListDetails details = 1;
repeated zitadel.metadata.v2.Metadata result = 2;
}
message GetMetadataRequest{
// The user ID of the user you like to get the metadata from.
string user_id = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
// Metadata key is the unique identifier of the metadata entry.
string metadata_key = 2 [(validate.rules).string = {min_len: 1, max_len: 200}];
}
message GetMetadataResponse{
zitadel.metadata.v2.Metadata metadata = 1;
}
message AddMetadataRequest{
// The user ID of the user you like to add the metadata to.
string user_id = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
// Metadata key is the unique identifier of the metadata entry.
// If an entry with the same key already exists, an error is returned.
string metadata_key = 2 [(validate.rules).string = {min_len: 1, max_len: 200}];
// Metadata value is the value of the metadata entry.
bytes metadata_value = 3 [(validate.rules).bytes = {min_len: 1, max_len: 500000}];
}
message AddMetadataResponse{
// CreationDate is the timestamp the metadata entry was created.
google.protobuf.Timestamp creation_date = 1;
}
message UpdateMetadataRequest{
// The user ID of the user you like to update the metadata from.
string user_id = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
// Metadata key is the unique identifier of the metadata entry.
// If an entry with the same key does not exist, an error is returned.
string metadata_key = 2 [(validate.rules).string = {min_len: 1, max_len: 200}];
// Metadata value is the value of the metadata entry.
bytes metadata_value = 3 [(validate.rules).bytes = {min_len: 1, max_len: 500000}];
}
message UpdateMetadataResponse{
// ChangeDate is the the timestamp the metadata entry was last updated.
google.protobuf.Timestamp change_date = 1;
}
message SetMetadataRequest{
// The user ID of the user you like to set the metadata from.
string user_id = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
// Metadata key is the unique identifier of the metadata entry.
// An existing entry with the same key will be updated. The key cannot be changed.
// If you need to change the key, remove the existing entry and create a new one.
string metadata_key = 2 [(validate.rules).string = {min_len: 1, max_len: 200}];
// Metadata value is the value of the metadata entry.
bytes metadata_value = 3 [(validate.rules).bytes = {min_len: 1, max_len: 500000}];
}
message SetMetadataResponse{
// ChangeDate is the the timestamp the metadata entry was last set, either created or updated.
google.protobuf.Timestamp change_date = 2;
}
message RemoveMetadataRequest{
// The user ID of the user you like to remove the metadata from.
string user_id = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
// Metadata key is the unique identifier of the metadata entry.
string metadata_key = 2 [(validate.rules).string = {min_len: 1, max_len: 200}];
}
message RemoveMetadataResponse{
// DeletionDate is the timestamp the metadata entry was deleted.
// Note that the deletion date is only guaranteed to be set if the deletion was successful during the request.
// In case the deletion occurred in a previous request, the deletion date might not be set.
google.protobuf.Timestamp deletion_date = 1;
}
message AddHumanUserRequest{
reserved 3;
reserved "organisation";
@@ -2514,3 +2429,88 @@ message HumanMFAInitSkippedRequest {
message HumanMFAInitSkippedResponse {
zitadel.object.v2.Details details = 1;
}
message ListMetadataRequest{
// The user ID of the user you like to get the metadata from.
string user_id = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
// Paginate through the results using a limit.
zitadel.object.v2.ListQuery query = 2;
// Filter the metadata to be returned.
repeated zitadel.metadata.v2.MetadataQuery queries = 3;
}
message ListMetadataResponse{
zitadel.object.v2.ListDetails details = 1;
repeated zitadel.metadata.v2.Metadata result = 2;
}
message GetMetadataRequest{
// The user ID of the user you like to get the metadata from.
string user_id = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
// Metadata key is the unique identifier of the metadata entry.
string metadata_key = 2 [(validate.rules).string = {min_len: 1, max_len: 200}];
}
message GetMetadataResponse{
zitadel.metadata.v2.Metadata metadata = 1;
}
message AddMetadataRequest{
// The user ID of the user you like to add the metadata to.
string user_id = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
// Metadata key is the unique identifier of the metadata entry.
// If an entry with the same key already exists, an error is returned.
string metadata_key = 2 [(validate.rules).string = {min_len: 1, max_len: 200}];
// Metadata value is the value of the metadata entry.
bytes metadata_value = 3 [(validate.rules).bytes = {min_len: 1, max_len: 500000}];
}
message AddMetadataResponse{
// CreationDate is the timestamp the metadata entry was created.
google.protobuf.Timestamp creation_date = 1;
}
message UpdateMetadataRequest{
// The user ID of the user you like to update the metadata from.
string user_id = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
// Metadata key is the unique identifier of the metadata entry.
// If an entry with the same key does not exist, an error is returned.
string metadata_key = 2 [(validate.rules).string = {min_len: 1, max_len: 200}];
// Metadata value is the value of the metadata entry.
bytes metadata_value = 3 [(validate.rules).bytes = {min_len: 1, max_len: 500000}];
}
message UpdateMetadataResponse{
// ChangeDate is the the timestamp the metadata entry was last updated.
google.protobuf.Timestamp change_date = 1;
}
message SetMetadataRequest{
// The user ID of the user you like to set the metadata from.
string user_id = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
// Metadata key is the unique identifier of the metadata entry.
// An existing entry with the same key will be updated. The key cannot be changed.
// If you need to change the key, remove the existing entry and create a new one.
string metadata_key = 2 [(validate.rules).string = {min_len: 1, max_len: 200}];
// Metadata value is the value of the metadata entry.
bytes metadata_value = 3 [(validate.rules).bytes = {min_len: 1, max_len: 500000}];
}
message SetMetadataResponse{
// ChangeDate is the the timestamp the metadata entry was last set, either created or updated.
google.protobuf.Timestamp change_date = 2;
}
message RemoveMetadataRequest{
// The user ID of the user you like to remove the metadata from.
string user_id = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
// Metadata key is the unique identifier of the metadata entry.
string metadata_key = 2 [(validate.rules).string = {min_len: 1, max_len: 200}];
}
message RemoveMetadataResponse{
// DeletionDate is the timestamp the metadata entry was deleted.
// Note that the deletion date is only guaranteed to be set if the deletion was successful during the request.
// In case the deletion occurred in a previous request, the deletion date might not be set.
google.protobuf.Timestamp deletion_date = 1;
}