11import base64
22import dataclasses
3- from datetime import datetime
43import enum
54import hashlib
65import json
3029from ddtrace .internal .packages import is_distribution_available
3130from ddtrace .internal .remoteconfig .constants import REMOTE_CONFIG_AGENT_ENDPOINT
3231from ddtrace .internal .service import ServiceStatus
33- from ddtrace .internal .utils .time import parse_isoformat
3432
3533from ..utils .formats import parse_tags_str
3634from ..utils .version import _pep440_to_semver
@@ -121,16 +119,14 @@ class Root:
121119 _type : str
122120 spec_version : str
123121 consistent_snapshot : bool
124- expires : datetime
122+ expires : str
125123 keys : Mapping [str , Key ]
126124 roles : Mapping [str , Role ]
127125 version : int
128126
129127 def __post_init__ (self ):
130128 if self ._type != "root" :
131129 raise ValueError ("Root: invalid root type" )
132- if isinstance (self .expires , str ):
133- self .expires = parse_isoformat (self .expires )
134130 for k , v in self .keys .items ():
135131 if isinstance (v , dict ):
136132 self .keys [k ] = Key (** v )
@@ -163,7 +159,7 @@ class TargetDesc:
163159class Targets :
164160 _type : str
165161 custom : Mapping [str , Any ]
166- expires : datetime
162+ expires : str
167163 spec_version : str
168164 targets : Mapping [str , TargetDesc ]
169165 version : int
@@ -173,8 +169,6 @@ def __post_init__(self):
173169 raise ValueError ("Targets: invalid targets type" )
174170 if self .spec_version not in ("1.0" , "1.0.0" ):
175171 raise ValueError ("Targets: invalid spec version" )
176- if isinstance (self .expires , str ):
177- self .expires = parse_isoformat (self .expires )
178172 for k , v in self .targets .items ():
179173 if isinstance (v , dict ):
180174 self .targets [k ] = TargetDesc (** v )
0 commit comments