// Identity — A company directory: people, groups and memberships — behind SCIM 2.0, SAML and OpenID Connect. // sondahub (https://sondahub.com): served over gRPC-Web and Connect at https://api.sondahub.com/grpc. // Writes are simulated: answered as a real server would, kept only in the x-sondahub-session token you send back. syntax = "proto3"; package sondahub.identity.v1; import "google/protobuf/struct.proto"; service IdentityService { // A page of users: page, limit, sort, q and filter (field → value, with the REST operator suffixes: price_lt → 20). rpc ListUsers(ListUsersRequest) returns (ListUsersResponse); // One user by id. rpc GetUser(GetUserRequest) returns (User); // Create a user (simulated, kept in your session token). id and the timestamps are set by the server. rpc CreateUser(User) returns (User); // Change the fields set in user (simulated). rpc UpdateUser(UpdateUserRequest) returns (User); // Delete one (simulated); answers what was removed. rpc DeleteUser(DeleteUserRequest) returns (User); // A page of groups: page, limit, sort, q and filter (field → value, with the REST operator suffixes: price_lt → 20). rpc ListGroups(ListGroupsRequest) returns (ListGroupsResponse); // One group by id. rpc GetGroup(GetGroupRequest) returns (Group); // Create a group (simulated, kept in your session token). id and the timestamps are set by the server. rpc CreateGroup(Group) returns (Group); // Change the fields set in group (simulated). rpc UpdateGroup(UpdateGroupRequest) returns (Group); // Delete one (simulated); answers what was removed. rpc DeleteGroup(DeleteGroupRequest) returns (Group); // A page of memberships: page, limit, sort, q and filter (field → value, with the REST operator suffixes: price_lt → 20). rpc ListMemberships(ListMembershipsRequest) returns (ListMembershipsResponse); // One membership by id. rpc GetMembership(GetMembershipRequest) returns (Membership); // Create a membership (simulated, kept in your session token). id and the timestamps are set by the server. rpc CreateMembership(Membership) returns (Membership); // Change the fields set in membership (simulated). rpc UpdateMembership(UpdateMembershipRequest) returns (Membership); // Delete one (simulated); answers what was removed. rpc DeleteMembership(DeleteMembershipRequest) returns (Membership); // The API's live activity as a server stream, each topic at its own pace: directory (every ~6 s), logins (every 2 s). max_events ends the stream (default 10, at most 120). rpc Watch(WatchRequest) returns (stream Event); } message User { // Assigned by the server. Seed records keep their ids across restarts; records you create continue after the seed. int64 id = 1; // When the record was created (ISO 8601, UTC). optional string created_at = 2; // When the record last changed. optional string updated_at = 3; // Unique login. optional string user_name = 4; optional string given_name = 5; optional string family_name = 6; // Defaults to given and family name. optional string display_name = 7; optional string email = 8; optional string title = 9; optional string department = 10; optional string employee_number = 11; // Who this person reports to; null for the CEO. optional int64 manager_id = 12; optional string phone = 13; optional string locale = 14; optional string timezone = 15; optional string office = 16; // false: deprovisioned — cannot sign in. optional bool active = 17; // The id an upstream system (an HR tool, an IdP) knows this person by. optional string external_id = 18; optional string last_login_at = 19; } message ListUsersRequest { int32 page = 1; int32 limit = 2; string sort = 3; string q = 4; map filter = 5; } message ListUsersResponse { repeated User data = 1; int32 page = 2; int32 limit = 3; int32 total = 4; int32 pages = 5; } message UpdateUserRequest { int64 id = 1; User user = 2; } message GetUserRequest { int64 id = 1; } message DeleteUserRequest { int64 id = 1; } message Group { // Assigned by the server. Seed records keep their ids across restarts; records you create continue after the seed. int64 id = 1; // When the record was created (ISO 8601, UTC). optional string created_at = 2; // When the record last changed. optional string updated_at = 3; optional string display_name = 4; optional string slug = 5; optional string kind = 6; optional string description = 7; optional string external_id = 8; optional int64 member_count = 9; } message ListGroupsRequest { int32 page = 1; int32 limit = 2; string sort = 3; string q = 4; map filter = 5; } message ListGroupsResponse { repeated Group data = 1; int32 page = 2; int32 limit = 3; int32 total = 4; int32 pages = 5; } message UpdateGroupRequest { int64 id = 1; Group group = 2; } message GetGroupRequest { int64 id = 1; } message DeleteGroupRequest { int64 id = 1; } message Membership { // Assigned by the server. Seed records keep their ids across restarts; records you create continue after the seed. int64 id = 1; // When the record was created (ISO 8601, UTC). optional string created_at = 2; // When the record last changed. optional string updated_at = 3; optional int64 user_id = 4; optional int64 group_id = 5; optional string role = 6; } message ListMembershipsRequest { int32 page = 1; int32 limit = 2; string sort = 3; string q = 4; map filter = 5; } message ListMembershipsResponse { repeated Membership data = 1; int32 page = 2; int32 limit = 3; int32 total = 4; int32 pages = 5; } message UpdateMembershipRequest { int64 id = 1; Membership membership = 2; } message GetMembershipRequest { int64 id = 1; } message DeleteMembershipRequest { int64 id = 1; } message WatchRequest { repeated string topics = 1; int32 max_events = 2; } message Event { string topic = 1; string api = 2; string ts = 3; google.protobuf.Struct data = 4; }