@@ -458,115 +458,6 @@ pub struct Service {
458458 pub tags : Vec < String > ,
459459}
460460
461- /// Information related ACL token.
462- /// See https://developer.hashicorp.com/consul/docs/security/acl/tokens for more information.
463- #[ derive( Debug , Serialize , Deserialize ) ]
464- #[ serde( rename_all = "PascalCase" ) ]
465- pub struct ACLToken {
466- /// Unique ID
467- #[ serde( rename = "AccessorID" ) ]
468- pub accessor_id : String ,
469- /// Secret for authenticatioIDn
470- #[ serde( rename = "SecretID" ) ]
471- pub secret_id : String ,
472- /// Description
473- pub description : String ,
474- /// Policies
475- pub policies : Option < Vec < ACLTokenPolicyLink > > ,
476- /// Token only valid in this datacenter
477- #[ serde( default ) ]
478- pub local : bool ,
479- /// creation time
480- pub create_time : String ,
481- /// hash
482- pub hash : String ,
483- /// create index
484- pub create_index : u64 ,
485- /// ModifyIndex is the last index that modified this key.
486- /// It can be used to establish blocking queries by setting the ?index query parameter.
487- pub modify_index : i64 ,
488- }
489-
490- /// Information related to Policies
491- /// see https://developer.hashicorp.com/consul/docs/security/acl/acl-policies for more information
492- #[ derive( Debug , Serialize , Deserialize , Default ) ]
493- #[ serde( rename_all = "PascalCase" ) ]
494- pub struct ACLTokenPolicyLink {
495- /// Policy ID
496- #[ serde( rename = "ID" ) ]
497- pub id : Option < String > ,
498- /// Policy name
499- pub name : Option < String > ,
500- }
501-
502- /// Create ACL token payload
503- /// See https://developer.hashicorp.com/consul/api-docs/acl/tokens for more information.
504- /// todo(): NodeIdentities,TemplatedPolicies, ServiceIdentities
505- #[ derive( Debug , Serialize , Deserialize , Default ) ]
506- #[ serde( rename_all = "PascalCase" ) ]
507- pub struct CreateACLTokenPayload {
508- /// Unique ID
509- #[ serde( rename = "AccessorID" ) ]
510- #[ serde( skip_serializing_if = "Option::is_none" ) ]
511- pub accessor_id : Option < String > ,
512- /// Secret for authenticatioIDn
513- #[ serde( rename = "SecretID" ) ]
514- #[ serde( skip_serializing_if = "Option::is_none" ) ]
515- pub secret_id : Option < String > ,
516- /// Description
517- #[ serde( skip_serializing_if = "Option::is_none" ) ]
518- pub description : Option < String > ,
519- /// Policies
520- #[ serde( skip_serializing_if = "Option::is_none" ) ]
521- pub policies : Option < Vec < ACLTokenPolicyLink > > ,
522- /// Token only valid in this datacenter
523- #[ serde( default ) ]
524- pub local : bool ,
525- /// creation time
526- #[ serde( skip_serializing_if = "Option::is_none" ) ]
527- pub create_time : Option < String > ,
528- /// hash
529- #[ serde( skip_serializing_if = "Option::is_none" ) ]
530- pub hash : Option < String > ,
531- /// duration
532- #[ serde( skip_serializing_if = "Option::is_none" ) ]
533- pub expiration_time : Option < Duration > ,
534- }
535-
536- /// Acl Policy
537- #[ derive( Debug , Serialize , Deserialize ) ]
538- #[ serde( rename_all = "PascalCase" ) ]
539- pub struct ACLPolicy {
540- /// id
541- #[ serde( rename = "ID" ) ]
542- pub id : String ,
543- /// name
544- pub name : String ,
545- /// Description
546- pub description : String ,
547- /// hash
548- pub hash : String ,
549- /// Create index
550- pub create_index : u32 ,
551- /// Datacenters
552- pub datacenters : Option < String > ,
553- /// modify index
554- pub modify_index : u32 ,
555- }
556-
557- /// Payload to create an ACL Policy
558- #[ derive( Debug , Serialize , Default ) ]
559- #[ serde( rename_all = "PascalCase" ) ]
560- pub struct CreateACLPolicyRequest {
561- /// Name of the policy (unique)
562- pub name : String ,
563- /// Description
564- pub description : Option < String > ,
565- /// rules in HCL format
566- // todo: Make the rules strongly typed
567- pub rules : Option < String > ,
568- }
569-
570461pub ( crate ) fn serialize_duration_as_string < S > (
571462 duration : & Duration ,
572463 serializer : S ,
0 commit comments