2016-10-04 10:45:04 +05:30
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package api;
|
|
|
|
|
2021-03-24 08:15:00 +05:30
|
|
|
option java_package = "com.coreos.dex.api";
|
|
|
|
option go_package = "github.com/dexidp/dex/api";
|
|
|
|
|
2016-10-04 10:45:04 +05:30
|
|
|
// Client represents an OAuth2 client.
|
|
|
|
message Client {
|
|
|
|
string id = 1;
|
|
|
|
string secret = 2;
|
|
|
|
repeated string redirect_uris = 3;
|
|
|
|
repeated string trusted_peers = 4;
|
|
|
|
bool public = 5;
|
|
|
|
string name = 6;
|
|
|
|
string logo_url = 7;
|
|
|
|
}
|
|
|
|
|
|
|
|
// CreateClientReq is a request to make a client.
|
|
|
|
message CreateClientReq {
|
|
|
|
Client client = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// CreateClientResp returns the response from creating a client.
|
|
|
|
message CreateClientResp {
|
|
|
|
bool already_exists = 1;
|
2021-03-24 08:15:00 +05:30
|
|
|
Client client = 2;
|
2016-10-04 10:45:04 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
// DeleteClientReq is a request to delete a client.
|
|
|
|
message DeleteClientReq {
|
|
|
|
// The ID of the client.
|
|
|
|
string id = 1;
|
|
|
|
}
|
|
|
|
|
2021-03-24 08:15:00 +05:30
|
|
|
// DeleteClientResp determines if the client is deleted successfully.
|
2016-10-04 10:45:04 +05:30
|
|
|
message DeleteClientResp {
|
|
|
|
bool not_found = 1;
|
|
|
|
}
|
|
|
|
|
2020-12-20 08:31:43 +05:30
|
|
|
// UpdateClientReq is a request to update an existing client.
|
2018-08-08 20:51:02 +05:30
|
|
|
message UpdateClientReq {
|
|
|
|
string id = 1;
|
|
|
|
repeated string redirect_uris = 2;
|
|
|
|
repeated string trusted_peers = 3;
|
2018-11-26 23:37:59 +05:30
|
|
|
string name = 4;
|
|
|
|
string logo_url = 5;
|
2018-08-08 20:51:02 +05:30
|
|
|
}
|
|
|
|
|
2020-12-20 08:31:51 +05:30
|
|
|
// UpdateClientResp returns the response from updating a client.
|
2018-08-08 20:51:02 +05:30
|
|
|
message UpdateClientResp {
|
|
|
|
bool not_found = 1;
|
|
|
|
}
|
|
|
|
|
2016-10-04 10:45:04 +05:30
|
|
|
// TODO(ericchiang): expand this.
|
|
|
|
|
2016-10-28 04:58:11 +05:30
|
|
|
// Password is an email for password mapping managed by the storage.
|
|
|
|
message Password {
|
|
|
|
string email = 1;
|
|
|
|
|
|
|
|
// Currently we do not accept plain text passwords. Could be an option in the future.
|
|
|
|
bytes hash = 2;
|
|
|
|
string username = 3;
|
|
|
|
string user_id = 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
// CreatePasswordReq is a request to make a password.
|
|
|
|
message CreatePasswordReq {
|
|
|
|
Password password = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// CreatePasswordResp returns the response from creating a password.
|
|
|
|
message CreatePasswordResp {
|
|
|
|
bool already_exists = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// UpdatePasswordReq is a request to modify an existing password.
|
|
|
|
message UpdatePasswordReq {
|
|
|
|
// The email used to lookup the password. This field cannot be modified
|
|
|
|
string email = 1;
|
|
|
|
bytes new_hash = 2;
|
|
|
|
string new_username = 3;
|
|
|
|
}
|
|
|
|
|
2021-03-24 08:15:00 +05:30
|
|
|
// UpdatePasswordResp returns the response from modifying an existing password.
|
2016-10-28 04:58:11 +05:30
|
|
|
message UpdatePasswordResp {
|
|
|
|
bool not_found = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// DeletePasswordReq is a request to delete a password.
|
|
|
|
message DeletePasswordReq {
|
|
|
|
string email = 1;
|
|
|
|
}
|
|
|
|
|
2021-03-24 08:15:00 +05:30
|
|
|
// DeletePasswordResp returns the response from deleting a password.
|
2016-10-28 04:58:11 +05:30
|
|
|
message DeletePasswordResp {
|
|
|
|
bool not_found = 1;
|
|
|
|
}
|
|
|
|
|
2016-11-18 04:20:58 +05:30
|
|
|
// ListPasswordReq is a request to enumerate passwords.
|
|
|
|
message ListPasswordReq {}
|
|
|
|
|
2017-02-11 01:03:54 +05:30
|
|
|
// ListPasswordResp returns a list of passwords.
|
2016-11-18 04:20:58 +05:30
|
|
|
message ListPasswordResp {
|
|
|
|
repeated Password passwords = 1;
|
|
|
|
}
|
|
|
|
|
2016-11-10 02:03:33 +05:30
|
|
|
// VersionReq is a request to fetch version info.
|
|
|
|
message VersionReq {}
|
|
|
|
|
|
|
|
// VersionResp holds the version info of components.
|
|
|
|
message VersionResp {
|
|
|
|
// Semantic version of the server.
|
|
|
|
string server = 1;
|
|
|
|
// Numeric version of the API. It increases everytime a new call is added to the API.
|
|
|
|
// Clients should use this info to determine if the server supports specific features.
|
|
|
|
int32 api = 2;
|
|
|
|
}
|
|
|
|
|
2017-02-11 01:03:54 +05:30
|
|
|
// RefreshTokenRef contains the metadata for a refresh token that is managed by the storage.
|
|
|
|
message RefreshTokenRef {
|
|
|
|
// ID of the refresh token.
|
|
|
|
string id = 1;
|
|
|
|
string client_id = 2;
|
2017-03-18 03:31:21 +05:30
|
|
|
int64 created_at = 5;
|
|
|
|
int64 last_used = 6;
|
2017-02-11 01:03:54 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
// ListRefreshReq is a request to enumerate the refresh tokens of a user.
|
|
|
|
message ListRefreshReq {
|
|
|
|
// The "sub" claim returned in the ID Token.
|
|
|
|
string user_id = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ListRefreshResp returns a list of refresh tokens for a user.
|
|
|
|
message ListRefreshResp {
|
|
|
|
repeated RefreshTokenRef refresh_tokens = 1;
|
|
|
|
}
|
|
|
|
|
2017-02-15 04:10:20 +05:30
|
|
|
// RevokeRefreshReq is a request to revoke the refresh token of the user-client pair.
|
|
|
|
message RevokeRefreshReq {
|
|
|
|
// The "sub" claim returned in the ID Token.
|
|
|
|
string user_id = 1;
|
|
|
|
string client_id = 2;
|
|
|
|
}
|
|
|
|
|
2021-03-24 08:15:00 +05:30
|
|
|
// RevokeRefreshResp determines if the refresh token is revoked successfully.
|
2017-02-15 04:10:20 +05:30
|
|
|
message RevokeRefreshResp {
|
|
|
|
// Set to true is refresh token was not found and token could not be revoked.
|
|
|
|
bool not_found = 1;
|
|
|
|
}
|
|
|
|
|
2018-08-07 00:34:56 +05:30
|
|
|
message VerifyPasswordReq {
|
|
|
|
string email = 1;
|
|
|
|
string password = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message VerifyPasswordResp {
|
|
|
|
bool verified = 1;
|
|
|
|
bool not_found = 2;
|
|
|
|
}
|
|
|
|
|
2016-10-04 10:45:04 +05:30
|
|
|
// Dex represents the dex gRPC service.
|
|
|
|
service Dex {
|
2016-11-10 02:03:33 +05:30
|
|
|
// CreateClient creates a client.
|
2016-10-04 10:45:04 +05:30
|
|
|
rpc CreateClient(CreateClientReq) returns (CreateClientResp) {};
|
2018-11-12 22:04:13 +05:30
|
|
|
// UpdateClient updates an existing client
|
2018-08-08 20:51:02 +05:30
|
|
|
rpc UpdateClient(UpdateClientReq) returns (UpdateClientResp) {};
|
2016-11-10 02:03:33 +05:30
|
|
|
// DeleteClient deletes the provided client.
|
2016-10-04 10:45:04 +05:30
|
|
|
rpc DeleteClient(DeleteClientReq) returns (DeleteClientResp) {};
|
2016-11-10 02:03:33 +05:30
|
|
|
// CreatePassword creates a password.
|
2016-10-28 04:58:11 +05:30
|
|
|
rpc CreatePassword(CreatePasswordReq) returns (CreatePasswordResp) {};
|
2016-11-10 02:03:33 +05:30
|
|
|
// UpdatePassword modifies existing password.
|
2016-10-28 04:58:11 +05:30
|
|
|
rpc UpdatePassword(UpdatePasswordReq) returns (UpdatePasswordResp) {};
|
2016-11-10 02:03:33 +05:30
|
|
|
// DeletePassword deletes the password.
|
2016-10-28 04:58:11 +05:30
|
|
|
rpc DeletePassword(DeletePasswordReq) returns (DeletePasswordResp) {};
|
2016-11-18 04:20:58 +05:30
|
|
|
// ListPassword lists all password entries.
|
|
|
|
rpc ListPasswords(ListPasswordReq) returns (ListPasswordResp) {};
|
2016-11-10 02:03:33 +05:30
|
|
|
// GetVersion returns version information of the server.
|
|
|
|
rpc GetVersion(VersionReq) returns (VersionResp) {};
|
2017-02-11 01:03:54 +05:30
|
|
|
// ListRefresh lists all the refresh token entries for a particular user.
|
|
|
|
rpc ListRefresh(ListRefreshReq) returns (ListRefreshResp) {};
|
2017-02-15 04:10:20 +05:30
|
|
|
// RevokeRefresh revokes the refresh token for the provided user-client pair.
|
|
|
|
//
|
|
|
|
// Note that each user-client pair can have only one refresh token at a time.
|
|
|
|
rpc RevokeRefresh(RevokeRefreshReq) returns (RevokeRefreshResp) {};
|
2018-08-07 00:34:56 +05:30
|
|
|
// VerifyPassword returns whether a password matches a hash for a specific email or not.
|
|
|
|
rpc VerifyPassword(VerifyPasswordReq) returns (VerifyPasswordResp) {};
|
2016-10-04 10:45:04 +05:30
|
|
|
}
|