@@ -71,12 +71,15 @@ func ExpandKeyUsage(usage string) *key_manager.KeyUsage {
7171 switch usage {
7272 case "symmetric_encryption" :
7373 alg := key_manager .KeyAlgorithmSymmetricEncryptionAes256Gcm
74+
7475 return & key_manager.KeyUsage {SymmetricEncryption : & alg }
7576 case "asymmetric_encryption" :
7677 alg := key_manager .KeyAlgorithmAsymmetricEncryptionRsaOaep3072Sha256
78+
7779 return & key_manager.KeyUsage {AsymmetricEncryption : & alg }
7880 case "asymmetric_signing" :
7981 alg := key_manager .KeyAlgorithmAsymmetricSigningEcP256Sha256
82+
8083 return & key_manager.KeyUsage {AsymmetricSigning : & alg }
8184 default :
8285 return nil
@@ -89,18 +92,22 @@ func ExpandKeyRotationPolicy(v any) (*key_manager.KeyRotationPolicy, error) {
8992 if ! ok || len (list ) == 0 {
9093 return nil , nil
9194 }
95+
9296 m , ok := list [0 ].(map [string ]any )
9397 if ! ok {
9498 return nil , nil
9599 }
100+
96101 periodStr , ok := m ["rotation_period" ].(string )
97102 if ! ok || periodStr == "" {
98103 return nil , nil
99104 }
105+
100106 period , err := time .ParseDuration (periodStr )
101107 if err != nil {
102108 return nil , err
103109 }
110+
104111 return & key_manager.KeyRotationPolicy {
105112 RotationPeriod : scw .NewDurationFromTimeDuration (period ),
106113 }, nil
@@ -111,10 +118,13 @@ func FlattenKeyRotationPolicy(rp *key_manager.KeyRotationPolicy) []map[string]an
111118 if rp == nil {
112119 return nil
113120 }
121+
114122 var periodStr string
123+
115124 if rp .RotationPeriod != nil {
116125 periodStr = rp .RotationPeriod .ToTimeDuration ().String ()
117126 }
127+
118128 return []map [string ]any {
119129 {
120130 "rotation_period" : periodStr ,
0 commit comments