syntax = "proto3"; package mairu; import "google/protobuf/timestamp.proto"; message Session { uint32 id = 1; string server_id = 2; string server_url = 3; google.protobuf.Timestamp expires_at = 4; } message Credentials { int64 version = 1; string access_key_id = 2; string secret_access_key = 3; string session_token = 4; google.protobuf.Timestamp expiration = 5; } service Agent { rpc PingAgent(PingAgentRequest) returns (PingAgentResponse); rpc GetServer(GetServerRequest) returns (GetServerResponse); rpc AssumeRole(AssumeRoleRequest) returns (AssumeRoleResponse); rpc ListSessions(ListSessionsRequest) returns (ListSessionsResponse); // rpc RemoveSession(RemoveSessionRequest) returns (RemoveSessionResponse) rpc InitiateOauthCode(InitiateOAuthCodeRequest) returns (InitiateOAuthCodeResponse); rpc CompleteOauthCode(CompleteOAuthCodeRequest) returns (CompleteOAuthCodeResponse); rpc RefreshAwsSsoClientRegistration(RefreshAwsSsoClientRegistrationRequest) returns (RefreshAwsSsoClientRegistrationResponse); rpc InitiateAwsSsoDevice(InitiateAwsSsoDeviceRequest) returns (InitiateAwsSsoDeviceResponse); rpc CompleteAwsSsoDevice(CompleteAwsSsoDeviceRequest) returns (CompleteAwsSsoDeviceResponse); } message PingAgentRequest { } message PingAgentResponse { string version = 1; } message GetServerRequest { string query = 1; bool no_cache = 2; } message GetServerResponse { string json = 1; bool cached = 2; } message AssumeRoleRequest { string server_id = 1; string role = 2; bool cached = 3; } message AssumeRoleResponse { Credentials credentials = 1; } message ListSessionsRequest { } message ListSessionsResponse { repeated Session sessions = 1; } message RemoveSessionRequest { string query = 1; } message RemoveSessionResponse { } message InitiateOAuthCodeRequest { string server_id = 1; string redirect_url = 2; } message InitiateOAuthCodeResponse { string handle = 1; string authorize_url = 2; } message CompleteOAuthCodeRequest { string handle = 1; string code = 2; string state = 3; } message CompleteOAuthCodeResponse { } message RefreshAwsSsoClientRegistrationRequest { string server_id = 1; } message RefreshAwsSsoClientRegistrationResponse { } message InitiateAwsSsoDeviceRequest { string server_id = 1; } message InitiateAwsSsoDeviceResponse { string handle = 1; string user_code = 2; string verification_uri = 3; string verification_uri_complete = 4; google.protobuf.Timestamp expires_at = 5; int32 interval = 6; } message CompleteAwsSsoDeviceRequest { string handle = 1; } message CompleteAwsSsoDeviceResponse { } //----- The following is used for mairu-exec subprocess IPC message ExecEnvVar { string name = 1; string value = 2; } message ExecEnvironment { repeated ExecEnvVar set_vars = 1; repeated string remove_vars = 2; } // NOTE: ExecEnvironmentAction (helper enum) is implemented directly on proto.rs message ExecIpcInformExecutorRequest { uint32 version = 1; message Ready { ExecEnvironment environment = 1; } message Failure { string error_message = 1; } oneof result { Ready ready = 2; Failure failure = 3; } }