argo-cd/server/session/session.proto
Josh Soref 5db8d97bf0
chore: Update swagger docs (#4610) (#4616)
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2020-10-20 20:28:57 +02:00

64 lines
1.6 KiB
Protocol Buffer

syntax = "proto3";
option go_package = "github.com/argoproj/argo-cd/pkg/apiclient/session";
// Session Service
//
// Session Service API performs CRUD actions against session resources
package session;
import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "k8s.io/api/core/v1/generated.proto";
import "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1/generated.proto";
// SessionCreateRequest is for logging in.
message SessionCreateRequest {
string username = 1;
string password = 2;
string token = 3;
}
// SessionDeleteRequest is for logging out.
message SessionDeleteRequest {}
// SessionResponse wraps the created token or returns an empty string if deleted.
message SessionResponse {
string token = 1;
}
// Get the current user's userInfo info
message GetUserInfoRequest {
}
// The current user's userInfo info
message GetUserInfoResponse {
bool loggedIn = 1;
string username = 2;
string iss = 3;
repeated string groups = 4;
}
// SessionService
service SessionService {
// Get the current user's info
rpc GetUserInfo (GetUserInfoRequest) returns (GetUserInfoResponse) {
option (google.api.http).get = "/api/v1/session/userinfo";
}
// Create a new JWT for authentication and set a cookie if using HTTP
rpc Create(SessionCreateRequest) returns (SessionResponse) {
option (google.api.http) = {
post: "/api/v1/session"
body: "*"
};
}
// Delete an existing JWT cookie if using HTTP
rpc Delete(SessionDeleteRequest) returns (SessionResponse) {
option (google.api.http) = {
delete: "/api/v1/session"
};
}
}