mirror of
https://github.com/juanfont/headscale.git
synced 2026-01-23 02:24:10 +00:00
parent
1eedf42828
commit
91f82b24cb
3 changed files with 47 additions and 4 deletions
|
|
@ -189,6 +189,7 @@ func (x *CreateApiKeyResponse) GetApiKey() string {
|
||||||
type ExpireApiKeyRequest struct {
|
type ExpireApiKeyRequest struct {
|
||||||
state protoimpl.MessageState `protogen:"open.v1"`
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
Prefix string `protobuf:"bytes,1,opt,name=prefix,proto3" json:"prefix,omitempty"`
|
Prefix string `protobuf:"bytes,1,opt,name=prefix,proto3" json:"prefix,omitempty"`
|
||||||
|
Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"`
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
}
|
}
|
||||||
|
|
@ -230,6 +231,13 @@ func (x *ExpireApiKeyRequest) GetPrefix() string {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *ExpireApiKeyRequest) GetId() uint64 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Id
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
type ExpireApiKeyResponse struct {
|
type ExpireApiKeyResponse struct {
|
||||||
state protoimpl.MessageState `protogen:"open.v1"`
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
@ -349,6 +357,7 @@ func (x *ListApiKeysResponse) GetApiKeys() []*ApiKey {
|
||||||
type DeleteApiKeyRequest struct {
|
type DeleteApiKeyRequest struct {
|
||||||
state protoimpl.MessageState `protogen:"open.v1"`
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
Prefix string `protobuf:"bytes,1,opt,name=prefix,proto3" json:"prefix,omitempty"`
|
Prefix string `protobuf:"bytes,1,opt,name=prefix,proto3" json:"prefix,omitempty"`
|
||||||
|
Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"`
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
}
|
}
|
||||||
|
|
@ -390,6 +399,13 @@ func (x *DeleteApiKeyRequest) GetPrefix() string {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *DeleteApiKeyRequest) GetId() uint64 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Id
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
type DeleteApiKeyResponse struct {
|
type DeleteApiKeyResponse struct {
|
||||||
state protoimpl.MessageState `protogen:"open.v1"`
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
@ -445,15 +461,17 @@ const file_headscale_v1_apikey_proto_rawDesc = "" +
|
||||||
"expiration\x18\x01 \x01(\v2\x1a.google.protobuf.TimestampR\n" +
|
"expiration\x18\x01 \x01(\v2\x1a.google.protobuf.TimestampR\n" +
|
||||||
"expiration\"/\n" +
|
"expiration\"/\n" +
|
||||||
"\x14CreateApiKeyResponse\x12\x17\n" +
|
"\x14CreateApiKeyResponse\x12\x17\n" +
|
||||||
"\aapi_key\x18\x01 \x01(\tR\x06apiKey\"-\n" +
|
"\aapi_key\x18\x01 \x01(\tR\x06apiKey\"=\n" +
|
||||||
"\x13ExpireApiKeyRequest\x12\x16\n" +
|
"\x13ExpireApiKeyRequest\x12\x16\n" +
|
||||||
"\x06prefix\x18\x01 \x01(\tR\x06prefix\"\x16\n" +
|
"\x06prefix\x18\x01 \x01(\tR\x06prefix\x12\x0e\n" +
|
||||||
|
"\x02id\x18\x02 \x01(\x04R\x02id\"\x16\n" +
|
||||||
"\x14ExpireApiKeyResponse\"\x14\n" +
|
"\x14ExpireApiKeyResponse\"\x14\n" +
|
||||||
"\x12ListApiKeysRequest\"F\n" +
|
"\x12ListApiKeysRequest\"F\n" +
|
||||||
"\x13ListApiKeysResponse\x12/\n" +
|
"\x13ListApiKeysResponse\x12/\n" +
|
||||||
"\bapi_keys\x18\x01 \x03(\v2\x14.headscale.v1.ApiKeyR\aapiKeys\"-\n" +
|
"\bapi_keys\x18\x01 \x03(\v2\x14.headscale.v1.ApiKeyR\aapiKeys\"=\n" +
|
||||||
"\x13DeleteApiKeyRequest\x12\x16\n" +
|
"\x13DeleteApiKeyRequest\x12\x16\n" +
|
||||||
"\x06prefix\x18\x01 \x01(\tR\x06prefix\"\x16\n" +
|
"\x06prefix\x18\x01 \x01(\tR\x06prefix\x12\x0e\n" +
|
||||||
|
"\x02id\x18\x02 \x01(\x04R\x02id\"\x16\n" +
|
||||||
"\x14DeleteApiKeyResponseB)Z'github.com/juanfont/headscale/gen/go/v1b\x06proto3"
|
"\x14DeleteApiKeyResponseB)Z'github.com/juanfont/headscale/gen/go/v1b\x06proto3"
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
||||||
|
|
@ -721,6 +721,8 @@ func local_request_HeadscaleService_ListApiKeys_0(ctx context.Context, marshaler
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var filter_HeadscaleService_DeleteApiKey_0 = &utilities.DoubleArray{Encoding: map[string]int{"prefix": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
|
||||||
|
|
||||||
func request_HeadscaleService_DeleteApiKey_0(ctx context.Context, marshaler runtime.Marshaler, client HeadscaleServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
func request_HeadscaleService_DeleteApiKey_0(ctx context.Context, marshaler runtime.Marshaler, client HeadscaleServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
var (
|
var (
|
||||||
protoReq DeleteApiKeyRequest
|
protoReq DeleteApiKeyRequest
|
||||||
|
|
@ -735,6 +737,12 @@ func request_HeadscaleService_DeleteApiKey_0(ctx context.Context, marshaler runt
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "prefix", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "prefix", err)
|
||||||
}
|
}
|
||||||
|
if err := req.ParseForm(); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_HeadscaleService_DeleteApiKey_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
msg, err := client.DeleteApiKey(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.DeleteApiKey(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
@ -753,6 +761,12 @@ func local_request_HeadscaleService_DeleteApiKey_0(ctx context.Context, marshale
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "prefix", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "prefix", err)
|
||||||
}
|
}
|
||||||
|
if err := req.ParseForm(); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_HeadscaleService_DeleteApiKey_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
msg, err := server.DeleteApiKey(ctx, &protoReq)
|
msg, err := server.DeleteApiKey(ctx, &protoReq)
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -124,6 +124,13 @@
|
||||||
"in": "path",
|
"in": "path",
|
||||||
"required": true,
|
"required": true,
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"in": "query",
|
||||||
|
"required": false,
|
||||||
|
"type": "string",
|
||||||
|
"format": "uint64"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
|
|
@ -1012,6 +1019,10 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"prefix": {
|
"prefix": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
},
|
||||||
|
"id": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "uint64"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue