All Downloads are FREE. Search and download functionalities are using the official Maven repository.

rion.user-service-model.1.0.4.source-code.user.proto Maven / Gradle / Ivy

There is a newer version: 1.0.9
Show newest version
syntax = "proto3";

package truward.orion.user;

option java_package = "com.truward.orion.user.service.model";
option java_outer_classname = "UserModel";

enum ContactType {
  UNKNOWN = 0;
  PHONE = 1;
  EMAIL = 2;
}

message Contact {
  string number = 1;
  ContactType type = 2;
}

message UserAccount {
  int64 id = 1;
  string nickname = 2;
  string passwordHash = 3;
  repeated Contact contacts = 4;
  repeated string authorities = 5;
  int64 created = 6;
  bool active = 7;
}

//
// Service Messages
//

// (Admin only) List Accounts

message ListAccountsRequest {
  string offsetToken = 1;
  int32 limit = 2;
}

message ListAccountsResponse {
  repeated UserAccount accounts = 1;
  string offsetToken = 2;
}

// Account Lookups

message AccountLookupRequest {
  string username = 1;

  // include contacts to the resultant user account?
  bool includeContacts = 2;
}

message AccountLookupResponse {
  UserAccount account = 1;
}

message AccountPresenceRequest {
  string nickname = 1;
  repeated Contact contacts = 2;
}

message AccountPresenceResponse {
  bool exists = 1;
}

// Account Registration

message RegisterAccountRequest {
  string nickname = 1;
  string passwordHash = 2;
  repeated Contact contacts = 3;
  repeated string authorities = 4;
  string invitationToken = 5;
}

message RegisterAccountResponse {
  int64 userId = 1;
}

// Account Update

message UpdateAccountRequest {
  int64 userId = 1;
  string nickname = 2;
  string passwordHash = 3; // admin only
  repeated Contact contacts = 4;
  repeated string authorities = 5; // admin/service only
  bool active = 6; // admin only
}

message UpdateAccountResponse {
}

// Reset Password

message ResetPasswordRequest {
  int64 userId = 1;
  string newPasswordHash = 4;
}

// Invitation Tokens

message CreateInvitationTokensRequest {
  int32 count = 1;
  repeated string authorities = 2;

  // when this token should expire?
  int64 expirationTime = 3;
}

message CreateInvitationTokensResponse {
  repeated string invitationTokens = 1;
}

// Account Deletion

message DeleteAccountsRequest {
  repeated int64 userIds = 1;
}

message DeleteAccountsResponse {
}

// Deactivation utilities

message DeactivateUsersWithAuthoritiesRequest {
  repeated string authorities = 1;
}

message DeactivateUsersWithAuthoritiesResponse {
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy