syntax = "proto3";

package core;

message AuthorizationServerMetadata {
  string authorization_endpoint = 1;
  repeated string code_challenge_methods_supported = 2;
  repeated string grant_types_supported = 3;
  string issuer = 4;
  string introspection_endpoint = 5;
  repeated string introspection_endpoint_auth_methods_supported = 6;
  string jwks_uri = 7;
  string op_policy_uri = 8;
  string op_tos_uri = 9;
  string registration_endpoint = 10;
  repeated string response_types_supported = 11;
  repeated string response_modes = 12;
  string revocation_endpoint = 13;
  repeated string revocation_endpoint_auth_methods_supported = 14;
  repeated string scopes_supported = 15;
  string service_documentation = 16;
  string token_endpoint = 17;
  repeated string token_endpoint_auth_methods_supported = 18;
  repeated string token_endpoint_auth_signing_alg_values_supported = 19;
  string userinfo_endpoint = 20;
  repeated string ui_locales_supported = 21;
}

message Address {
  string id = 1;
  string user_id = 2;
  string city = 3;
  string country = 4;
  bool isDefault = 5;
  string line1 = 6;
  string line2 = 7;
  string mobile = 8;
  string postal_code = 9;
  string region = 10;
  string telephone = 11;
  string created_at = 12;
  string deleted_at = 13;
  string updated_at = 14;
}

message Client {
  string id = 1;
  string user_id = 2;
  repeated string contacts = 3;
  string description = 4;
  repeated string grant_types = 5;
  bool is_first_party = 6;
  JWKS jwks = 7;
  string jwks_uri = 8;
  string logo_uri = 9;
  string name = 10;
  string policy_uri = 11;
  string public_keys_configuration = 12;
  repeated string redirect_uris = 13;
  repeated string response_types = 14;
  string refresh_token_rotation_type = 15;
  string secret = 16;
  string scope = 17;
  string software_id = 18;
  string software_version = 19;
  string tos_uri = 20;
  string token_endpoint_auth_method = 21;
  string type = 22;
  string uri = 23;
  string created_at = 24;
  string deleted_at = 25;
  string updated_at = 26;
}

message ClientApproval {
  string id = 1;
  string user_id = 2;
  string client_id = 3;
  repeated Scope scopes = 4;
  string created_at = 5;
  string deleted_at = 6;
  string updated_at = 7;
}

message DeleteRequest {
  string id = 1;
}

message Empty {}

message GetRequest {
  string id = 1;
}

message Profile {
  string id = 1;
  string user_id = 2;
  string birthdate = 3;
  string first_name = 4;
  string gender = 5;
  string locale = 6;
  string last_name = 7;
  string middle_name = 8;
  string nickname = 9;
  string profile = 10;
  string picture = 11;
  string user = 12;
  string website = 13;
  string zoneinfo = 14;
  string created_at = 15;
  string deleted_at = 16;
  string updated_at = 17;
}

message PublicJWK {
  string kid = 1;
  string kty = 2;
  string e = 3;
  string use = 4;
  string alg = 5;
  string n = 6;
}

message PrivateJWK {
  string kid = 1;
  string p = 2;
  string kty = 3;
  string q = 4;
  string d = 5;
  string e = 6;
  string use = 7;
  string qi = 8;
  string dp = 9;
  string alg = 10;
  string dq = 11;
  string n = 12;
}

message JWKS {
  repeated PublicJWK keys = 1;
}

message ListRequest {
  string parent = 1;
  int32 page_size = 2;
  string page_token = 3;
}

message Scope {
  string id = 1;
  string description = 2;
  string display_name = 3;
  string name = 4;
  string created_at = 5;
  string deleted_at = 6;
  string updated_at = 7;
}

message User {
  string id = 1;
  repeated Address addresses = 2;
  repeated ClientApproval client_approvals = 3;
  string email = 4;
  bool emailVerified = 5;
  string phoneNumber = 6;
  bool phoneNumberVerified = 7;
  Profile profile = 8;
  string password = 9;
  string username = 10;
  string created_at = 11;
  string deleted_at = 12;
  string updated_at = 13;
}