Add proto model for api key

This commit is contained in:
Kristoffer Dalby 2022-01-25 22:11:15 +00:00
parent 70d82ea184
commit b8e9024845
3 changed files with 65 additions and 7 deletions

View file

@ -8,6 +8,7 @@ import "headscale/v1/namespace.proto";
import "headscale/v1/preauthkey.proto";
import "headscale/v1/machine.proto";
import "headscale/v1/routes.proto";
import "headscale/v1/apikey.proto";
// import "headscale/v1/device.proto";
service HeadscaleService {
@ -131,6 +132,28 @@ service HeadscaleService {
}
// --- Route end ---
// --- ApiKeys start ---
rpc CreateApiKey(CreateApiKeyRequest) returns (CreateApiKeyResponse) {
option (google.api.http) = {
post: "/api/v1/apikey"
body: "*"
};
}
rpc ExpireApiKey(ExpireApiKeyRequest) returns (ExpireApiKeyResponse) {
option (google.api.http) = {
post: "/api/v1/apikey/expire"
body: "*"
};
}
rpc ListApiKeys(ListApiKeysRequest) returns (ListApiKeysResponse) {
option (google.api.http) = {
get: "/api/v1/apikey"
};
}
// --- ApiKeys end ---
// Implement Tailscale API
// rpc GetDevice(GetDeviceRequest) returns(GetDeviceResponse) {
// option(google.api.http) = {