@@ -286,6 +286,10 @@ type (
286286 DisableIPv4 bool `json:"disableIPv4,omitempty" hujson:"DisableIPv4,omitempty"`
287287 OneCGNATRoute string `json:"oneCGNATRoute,omitempty" hujson:"OneCGNATRoute,omitempty"`
288288 RandomizeClientPort bool `json:"randomizeClientPort,omitempty" hujson:"RandomizeClientPort,omitempty"`
289+
290+ // As of Aug 2023 these fields are experimental and subject to change.
291+ Postures map [string ][]string `json:"postures,omitempty" hujson:"Postures,omitempty"`
292+ DefaultSourcePosture []string `json:"defaultSrcPosture,omitempty" hujson:"DefaultSrcPosture,omitempty"`
289293 }
290294
291295 ACLAutoApprovers struct {
@@ -300,6 +304,9 @@ type (
300304 Source []string `json:"src,omitempty" hujson:"Src,omitempty"`
301305 Destination []string `json:"dst,omitempty" hujson:"Dst,omitempty"`
302306 Protocol string `json:"proto,omitempty" hujson:"Proto,omitempty"`
307+
308+ // Experimental.
309+ SourcePosture []string `json:"srcPosture,omitempty" hujson:"SrcPosture,omitempty"`
303310 }
304311
305312 ACLTest struct {
@@ -338,11 +345,13 @@ type (
338345 }
339346
340347 ACLSSH struct {
341- Action string `json:"action,omitempty" hujson:"Action,omitempty"`
342- Users []string `json:"users,omitempty" hujson:"Users,omitempty"`
343- Source []string `json:"src,omitempty" hujson:"Src,omitempty"`
344- Destination []string `json:"dst,omitempty" hujson:"Dst,omitempty"`
345- CheckPeriod Duration `json:"checkPeriod,omitempty" hujson:"CheckPeriod,omitempty"`
348+ Action string `json:"action,omitempty" hujson:"Action,omitempty"`
349+ Users []string `json:"users,omitempty" hujson:"Users,omitempty"`
350+ Source []string `json:"src,omitempty" hujson:"Src,omitempty"`
351+ Destination []string `json:"dst,omitempty" hujson:"Dst,omitempty"`
352+ CheckPeriod Duration `json:"checkPeriod,omitempty" hujson:"CheckPeriod,omitempty"`
353+ Recorder []string `json:"recorder,omitempty" hujson:"Recorder,omitempty"`
354+ EnforceRecorder bool `json:"enforceRecorder,omitempty" hujson:"EnforceRecorder,omitempty"`
346355 }
347356
348357 NodeAttrGrant struct {
@@ -550,10 +559,15 @@ func (c *Client) Devices(ctx context.Context) ([]Device, error) {
550559
551560// AuthorizeDevice marks the specified device identifier as authorized to join the tailnet.
552561func (c * Client ) AuthorizeDevice (ctx context.Context , deviceID string ) error {
562+ return c .SetDeviceAuthorized (ctx , deviceID , true )
563+ }
564+
565+ // SetDeviceAuthorized marks the specified device as authorized or not.
566+ func (c * Client ) SetDeviceAuthorized (ctx context.Context , deviceID string , authorized bool ) error {
553567 const uriFmt = "/api/v2/device/%s/authorized"
554568
555569 req , err := c .buildRequest (ctx , http .MethodPost , fmt .Sprintf (uriFmt , deviceID ), nil , map [string ]bool {
556- "authorized" : true ,
570+ "authorized" : authorized ,
557571 })
558572 if err != nil {
559573 return err
0 commit comments