Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/protos/io/restorecommerce/auth.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ message Tokens {
optional bool interactive = 6;
optional google.protobuf.Timestamp last_login = 7;
optional string client_id = 8;
optional string impersonated_by = 9; // ID of the impersonator
}

message HierarchicalScope {
Expand Down
29 changes: 29 additions & 0 deletions packages/protos/io/restorecommerce/user.proto
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ service UserService {
rpc ResetTOTP (ResetTOTPRequest) returns (io.restorecommerce.status.OperationStatusObj);
rpc MfaStatus (MfaStatusRequest) returns (MfaStatusResponse);
rpc GetUnauthenticatedSubjectTokenForTenant(TenantRequest) returns (TenantResponse);
rpc Impersonate (ImpersonateRequest) returns (ImpersonateResponse);
rpc EndImpersonation (EndImpersonationRequest) returns (EndImpersonateResponse);
}

/**
Expand All @@ -70,6 +72,33 @@ message LoginRequest {
optional string token = 3;
}

message ImpersonateRequest {
optional string identifier = 1; // Username to impersonate
optional io.restorecommerce.auth.Subject subject = 2; // Impersonator's subject
}

message AccessTokenData {
optional string access_token = 1;
optional google.protobuf.Timestamp expires_in = 2;
optional string token_type = 3;
optional string scope = 4;
optional string token_name = 5;
}

message ImpersonateResponse {
optional io.restorecommerce.status.Status status = 1;
optional AccessTokenData payload = 2;
}

message EndImpersonationRequest {
optional io.restorecommerce.auth.Subject subject = 1;
}

message EndImpersonateResponse {
optional io.restorecommerce.status.Status status = 1;
optional AccessTokenData payload = 2;
}

message LoginResponse {
optional User payload = 1;
optional io.restorecommerce.status.Status status = 2;
Expand Down
Loading