Set tags as part of handleAuthKeyCommon
This commit is contained in:
parent
6faa1d2e4a
commit
ac18723dd4
5 changed files with 75 additions and 6 deletions
12
grpcv1.go
12
grpcv1.go
|
@ -106,6 +106,18 @@ func (api headscaleV1APIServer) CreatePreAuthKey(
|
|||
expiration = request.GetExpiration().AsTime()
|
||||
}
|
||||
|
||||
if len(request.AclTags) > 0 {
|
||||
for _, tag := range request.AclTags {
|
||||
err := validateTag(tag)
|
||||
|
||||
if err != nil {
|
||||
return &v1.CreatePreAuthKeyResponse{
|
||||
PreAuthKey: nil,
|
||||
}, status.Error(codes.InvalidArgument, err.Error())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
preAuthKey, err := api.h.CreatePreAuthKey(
|
||||
request.GetNamespace(),
|
||||
request.GetReusable(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue