diff --git a/gen/go/security/jwt/v1/config.pb.go b/gen/go/security/jwt/v1/config.pb.go index 3d138c4..63ae16e 100644 --- a/gen/go/security/jwt/v1/config.pb.go +++ b/gen/go/security/jwt/v1/config.pb.go @@ -140,63 +140,60 @@ var file_security_jwt_v1_config_proto_rawDesc = []byte{ 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0xbb, 0x05, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x70, 0x0a, 0x0e, 0x73, 0x69, + 0x89, 0x05, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x69, 0x0a, 0x0e, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x48, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0xba, 0x47, 0x3e, 0x92, 0x02, - 0x3b, 0x54, 0x68, 0x65, 0x20, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x6d, 0x65, 0x74, - 0x68, 0x6f, 0x64, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, - 0x20, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x20, 0x28, 0x65, 0x2e, 0x67, 0x2e, 0x2c, 0x20, 0x48, 0x53, - 0x32, 0x35, 0x36, 0x2c, 0x20, 0x52, 0x53, 0x32, 0x35, 0x36, 0x29, 0x2e, 0x52, 0x0e, 0x73, 0x69, - 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x42, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x30, 0xfa, 0x42, 0x04, 0x72, 0x02, - 0x10, 0x01, 0xba, 0x47, 0x26, 0x92, 0x02, 0x23, 0x54, 0x68, 0x65, 0x20, 0x6b, 0x65, 0x79, 0x20, - 0x75, 0x73, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, - 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x47, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x32, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x33, - 0xba, 0x47, 0x30, 0x92, 0x02, 0x2d, 0x54, 0x68, 0x65, 0x20, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, - 0x61, 0x72, 0x79, 0x20, 0x6b, 0x65, 0x79, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, - 0x20, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x2e, 0x52, 0x04, 0x6b, 0x65, 0x79, 0x32, 0x12, 0x5d, 0x0a, 0x15, 0x61, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x6c, 0x69, 0x66, 0x65, 0x74, 0x69, - 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x42, 0x27, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x20, - 0x00, 0xba, 0x47, 0x1d, 0x92, 0x02, 0x1a, 0x54, 0x68, 0x65, 0x20, 0x6c, 0x69, 0x66, 0x65, 0x74, - 0x69, 0x6d, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x2e, 0x52, 0x15, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, - 0x6c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x67, 0x0a, 0x16, 0x72, 0x65, 0x66, 0x72, - 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x6c, 0x69, 0x66, 0x65, 0x74, 0x69, - 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x42, 0x2f, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x20, - 0x00, 0xba, 0x47, 0x25, 0x92, 0x02, 0x22, 0x54, 0x68, 0x65, 0x20, 0x6c, 0x69, 0x66, 0x65, 0x74, - 0x69, 0x6d, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x66, 0x72, 0x65, - 0x73, 0x68, 0x20, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x52, 0x16, 0x72, 0x65, 0x66, 0x72, 0x65, - 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x6c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, - 0x65, 0x12, 0x3d, 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x25, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0xba, 0x47, 0x1b, 0x92, 0x02, 0x18, - 0x54, 0x68, 0x65, 0x20, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, - 0x65, 0x20, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, - 0x12, 0x57, 0x0a, 0x08, 0x61, 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x08, 0x20, 0x03, - 0x28, 0x09, 0x42, 0x3b, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x08, 0x01, 0xba, 0x47, 0x30, 0x92, - 0x02, 0x2d, 0x54, 0x68, 0x65, 0x20, 0x61, 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x20, 0x66, - 0x6f, 0x72, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x2e, 0x52, - 0x08, 0x61, 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x52, 0x0a, 0x0a, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, 0x32, 0xfa, - 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0xba, 0x47, 0x28, 0x92, 0x02, 0x25, 0x54, 0x68, 0x65, 0x20, - 0x74, 0x79, 0x70, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x20, 0x28, 0x65, 0x2e, 0x67, 0x2e, 0x2c, 0x20, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x29, - 0x2e, 0x52, 0x0a, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x42, 0xbe, 0x01, - 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2e, 0x6a, - 0x77, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x6f, 0x72, 0x69, 0x67, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x72, 0x75, 0x6e, 0x74, 0x69, - 0x6d, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, - 0x74, 0x79, 0x2f, 0x6a, 0x77, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x6a, 0x77, 0x74, 0x76, 0x31, 0xf8, - 0x01, 0x01, 0xa2, 0x02, 0x03, 0x53, 0x4a, 0x58, 0xaa, 0x02, 0x0f, 0x53, 0x65, 0x63, 0x75, 0x72, - 0x69, 0x74, 0x79, 0x2e, 0x4a, 0x77, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x53, 0x65, 0x63, - 0x75, 0x72, 0x69, 0x74, 0x79, 0x5c, 0x4a, 0x77, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x53, - 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5c, 0x4a, 0x77, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x53, 0x65, 0x63, - 0x75, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x3a, 0x4a, 0x77, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x28, 0x09, 0x42, 0x41, 0xba, 0x47, 0x3e, 0x92, 0x02, 0x3b, 0x54, 0x68, 0x65, 0x20, 0x73, 0x69, + 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x75, 0x73, 0x65, + 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x20, + 0x28, 0x65, 0x2e, 0x67, 0x2e, 0x2c, 0x20, 0x48, 0x53, 0x32, 0x35, 0x36, 0x2c, 0x20, 0x52, 0x53, + 0x32, 0x35, 0x36, 0x29, 0x2e, 0x52, 0x0e, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x6d, + 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x3b, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x29, 0xba, 0x47, 0x26, 0x92, 0x02, 0x23, 0x54, 0x68, 0x65, 0x20, 0x6b, 0x65, + 0x79, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x73, 0x69, 0x67, 0x6e, 0x69, + 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x47, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x32, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x33, 0xba, 0x47, 0x30, 0x92, 0x02, 0x2d, 0x54, 0x68, 0x65, 0x20, 0x73, 0x65, 0x63, 0x6f, + 0x6e, 0x64, 0x61, 0x72, 0x79, 0x20, 0x6b, 0x65, 0x79, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x66, + 0x6f, 0x72, 0x20, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x52, 0x04, 0x6b, 0x65, 0x79, 0x32, 0x12, 0x56, 0x0a, 0x15, 0x61, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x6c, 0x69, 0x66, 0x65, + 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x42, 0x20, 0xba, 0x47, 0x1d, 0x92, + 0x02, 0x1a, 0x54, 0x68, 0x65, 0x20, 0x6c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x20, 0x6f, + 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x52, 0x15, 0x61, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x6c, 0x69, 0x66, 0x65, 0x74, + 0x69, 0x6d, 0x65, 0x12, 0x60, 0x0a, 0x16, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x6c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x03, 0x42, 0x28, 0xba, 0x47, 0x25, 0x92, 0x02, 0x22, 0x54, 0x68, 0x65, 0x20, 0x6c, + 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, + 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x20, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x52, 0x16, 0x72, + 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x6c, 0x69, 0x66, + 0x65, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1e, 0xba, 0x47, 0x1b, 0x92, 0x02, 0x18, 0x54, 0x68, 0x65, + 0x20, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x12, 0x4f, 0x0a, + 0x08, 0x61, 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, 0x42, + 0x33, 0xba, 0x47, 0x30, 0x92, 0x02, 0x2d, 0x54, 0x68, 0x65, 0x20, 0x61, 0x75, 0x64, 0x69, 0x65, + 0x6e, 0x63, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x74, 0x68, + 0x65, 0x20, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x6e, + 0x64, 0x65, 0x64, 0x2e, 0x52, 0x08, 0x61, 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x4b, + 0x0a, 0x0a, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x2b, 0xba, 0x47, 0x28, 0x92, 0x02, 0x25, 0x54, 0x68, 0x65, 0x20, 0x74, 0x79, + 0x70, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x20, + 0x28, 0x65, 0x2e, 0x67, 0x2e, 0x2c, 0x20, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x29, 0x2e, 0x52, + 0x0a, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x42, 0xbe, 0x01, 0x0a, 0x13, + 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2e, 0x6a, 0x77, 0x74, + 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, + 0x72, 0x69, 0x67, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, + 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, + 0x2f, 0x6a, 0x77, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x6a, 0x77, 0x74, 0x76, 0x31, 0xf8, 0x01, 0x01, + 0xa2, 0x02, 0x03, 0x53, 0x4a, 0x58, 0xaa, 0x02, 0x0f, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, + 0x79, 0x2e, 0x4a, 0x77, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x53, 0x65, 0x63, 0x75, 0x72, + 0x69, 0x74, 0x79, 0x5c, 0x4a, 0x77, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x53, 0x65, 0x63, + 0x75, 0x72, 0x69, 0x74, 0x79, 0x5c, 0x4a, 0x77, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x53, 0x65, 0x63, 0x75, 0x72, + 0x69, 0x74, 0x79, 0x3a, 0x3a, 0x4a, 0x77, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/gen/go/security/jwt/v1/config.pb.validate.go b/gen/go/security/jwt/v1/config.pb.validate.go index f7078bd..151a770 100644 --- a/gen/go/security/jwt/v1/config.pb.validate.go +++ b/gen/go/security/jwt/v1/config.pb.validate.go @@ -56,84 +56,19 @@ func (m *Config) validate(all bool) error { var errors []error - if utf8.RuneCountInString(m.GetSigningMethod()) < 1 { - err := ConfigValidationError{ - field: "SigningMethod", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } + // no validation rules for SigningMethod - if utf8.RuneCountInString(m.GetKey()) < 1 { - err := ConfigValidationError{ - field: "Key", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } + // no validation rules for Key // no validation rules for Key2 - if m.GetAccessTokenLifetime() <= 0 { - err := ConfigValidationError{ - field: "AccessTokenLifetime", - reason: "value must be greater than 0", - } - if !all { - return err - } - errors = append(errors, err) - } - - if m.GetRefreshTokenLifetime() <= 0 { - err := ConfigValidationError{ - field: "RefreshTokenLifetime", - reason: "value must be greater than 0", - } - if !all { - return err - } - errors = append(errors, err) - } + // no validation rules for AccessTokenLifetime - if utf8.RuneCountInString(m.GetIssuer()) < 1 { - err := ConfigValidationError{ - field: "Issuer", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } + // no validation rules for RefreshTokenLifetime - if len(m.GetAudience()) < 1 { - err := ConfigValidationError{ - field: "Audience", - reason: "value must contain at least 1 item(s)", - } - if !all { - return err - } - errors = append(errors, err) - } + // no validation rules for Issuer - if utf8.RuneCountInString(m.GetTokenType()) < 1 { - err := ConfigValidationError{ - field: "TokenType", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } + // no validation rules for TokenType if len(errors) > 0 { return ConfigMultiError(errors) diff --git a/proto/security/jwt/v1/config.proto b/proto/security/jwt/v1/config.proto index 4a99b20..e399d04 100644 --- a/proto/security/jwt/v1/config.proto +++ b/proto/security/jwt/v1/config.proto @@ -20,12 +20,10 @@ option php_namespace = "OrigAdmin\\Runtime\\Security\\JWT\\V1"; message Config { string signing_method = 1 [ json_name = "signing_method", - (validate.rules).string.min_len = 1, (gnostic.openapi.v3.property) = {description: "The signing method used for the token (e.g., HS256, RS256)."} ]; string key = 2 [ json_name = "key", - (validate.rules).string.min_len = 1, (gnostic.openapi.v3.property) = {description: "The key used for signing the token."} ]; string key2 = 3 [ @@ -34,27 +32,22 @@ message Config { ]; int64 access_token_lifetime = 5 [ json_name = "access_token_lifetime", - (validate.rules).int64.gt = 0, (gnostic.openapi.v3.property) = {description: "The lifetime of the token."} ]; int64 refresh_token_lifetime = 6 [ json_name = "refresh_token_lifetime", - (validate.rules).int64.gt = 0, (gnostic.openapi.v3.property) = {description: "The lifetime of the refresh token."} ]; string issuer = 7 [ json_name = "issuer", - (validate.rules).string.min_len = 1, (gnostic.openapi.v3.property) = {description: "The issuer of the token."} ]; repeated string audience = 8 [ json_name = "audience", - (validate.rules).repeated.min_items = 1, (gnostic.openapi.v3.property) = {description: "The audience for which the token is intended."} ]; // Audience string token_type = 9 [ json_name = "token_type", - (validate.rules).string.min_len = 1, (gnostic.openapi.v3.property) = {description: "The type of the token (e.g., Bearer)."} ]; }