Files
Swarm/DysonNetwork.Shared/Protos/auth.proto

70 lines
1.6 KiB
Protocol Buffer

syntax = "proto3";
package dyson_network.sphere.auth;
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
option csharp_namespace = "DysonNetwork.Shared.Protos.Auth";
service AuthService {
rpc Login(LoginRequest) returns (LoginResponse);
rpc IntrospectToken(IntrospectTokenRequest) returns (IntrospectionResponse);
rpc Logout(google.protobuf.Empty) returns (google.protobuf.Empty);
}
message LoginRequest {
string username = 1;
string password = 2;
optional string two_factor_code = 3;
}
message LoginResponse {
string access_token = 1;
string refresh_token = 2;
int64 expires_in = 3;
}
message IntrospectTokenRequest {
string token = 1;
optional string token_type_hint = 2;
}
message IntrospectionResponse {
bool active = 1;
string claims = 2;
string client_id = 3;
string username = 4;
string scope = 5;
google.protobuf.Timestamp iat = 6;
google.protobuf.Timestamp exp = 7;
}
message Session {
string id = 1;
string label = 2;
google.protobuf.Timestamp last_granted_at = 3;
google.protobuf.Timestamp expired_at = 4;
string account_id = 5;
string challenge_id = 6;
optional string app_id = 7;
}
message Challenge {
string id = 1;
google.protobuf.Timestamp expired_at = 2;
int32 step_remain = 3;
int32 step_total = 4;
int32 failed_attempts = 5;
string platform = 6;
string type = 7;
repeated string blacklist_factors = 8;
repeated string audiences = 9;
repeated string scopes = 10;
string ip_address = 11;
string user_agent = 12;
optional string device_id = 13;
optional string nonce = 14;
string account_id = 15;
}