77
88import uuid as std_uuid
99from datetime import datetime
10- from enum import StrEnum
10+ from enum import StrEnum , auto
1111from typing import Any , Literal , Optional
1212
1313from pydantic import BaseModel , Field , GetCoreSchemaHandler , GetJsonSchemaHandler
@@ -319,6 +319,7 @@ class PilotFieldsMapping(BaseModel, extra="forbid"):
319319 AccountingSent : Optional [bool ] = None
320320 CurrentJobID : Optional [int ] = None
321321
322+
322323class PilotStatus (StrEnum ):
323324 #: The pilot has been generated and is transferred to a remote site:
324325 SUBMITTED = "Submitted"
@@ -337,6 +338,7 @@ class PilotStatus(StrEnum):
337338 #: Cannot get information about the pilot status:
338339 UNKNOWN = "Unknown"
339340
341+
340342class PilotSecretConstraints (TypedDict , total = False ):
341343 VOs : list [str ] # Authorize only a list of VOs
342344 PilotStamps : list [str ] # Authorize only a list of stamps
@@ -345,6 +347,13 @@ class PilotSecretConstraints(TypedDict, total=False):
345347 # We can add constraints here
346348
347349
350+ class TokenType (StrEnum ):
351+ # Pilot token
352+ PILOT_TOKEN = auto ()
353+ # User token
354+ USER_TOKEN = auto ()
355+
356+
348357class PilotSecretsInfo (BaseModel ):
349358 pilot_secret : str
350359 pilot_secret_expires_in : int
0 commit comments