+
    i&                       ^ RI Ht ^ RIt^ RIHtHt ^ RIHt ^ RI	H
t
Ht ^ RIHt ^RIHt ^RIHt ]
'       d   ^ R	IHs ^ R
IHs ^ RIHs ^ RIHt MRsRsRsR R lt ! R R]]]R,          3,          4      t ! R R]4      tRR.tR# )    )annotationsN)IteratorMapping)cached_property)TYPE_CHECKINGAny)	FieldInfo)SecretVersion)EnvSettingsSourcedefaultCredentialsSecretManagerServiceClient)BaseSettingsc                   V ^8  d   QhRR/# )   returnNone )formats   "ځC:\Users\petid\OneDrive\Desktop\Maestro\MAESTRO\maestro-backend\venv\Lib\site-packages\pydantic_settings/sources/providers/gcp.py__annotate__r      s      4     c                     ^ RI Hs ^ RIHs \
        P                  ! 4       ;_uu_ 4        \
        P                  ! R\        R7       ^ RI	H
s
 RRR4       R#   + '       g   i     R# ; i  \         d   p \        R4      T hRp ? ii ; i)r   r   r   ignore)categoryr   NzjGCP Secret Manager dependencies are not installed, run `pip install pydantic-settings[gcp-secret-manager]`)google.authr   google_auth_defaultgoogle.auth.credentialsr   warningscatch_warningsfilterwarningsFutureWarninggoogle.cloud.secretmanagerr   ImportError)es    r   import_gcp_secret_managerr)      sb    

>7$$&&##H}EM '&&&  x
	s4   )A, #AA, A)	#A, )A, ,B7BBc                      ] tR t^+t$ R]R&   R]R&   R R lt]R R l4       tR	 R
 lt]	R R l4       t
]R R l4       tRR R lltRR R lltR R ltR R ltR R ltRtR# )GoogleSecretManagerMappingzdict[str, str | None]_loaded_secretsr   _secret_clientc               (    V ^8  d   QhRRRRRRRR/# )	r   secret_clientr   
project_idstrcase_sensitiveboolr   r   r   )r   s   "r   r   'GoogleSecretManagerMapping.__annotate__/   s+     . .&@ .c .cg .lp .r   c                	8    / V n         Wn        W n        W0n        R # N)r,   r-   _project_id_case_sensitive)selfr/   r0   r2   s   &&&&r   __init__#GoogleSecretManagerMapping.__init__/   s    !+%-r   c                   V ^8  d   QhRR/# r   r   r1   r   )r   s   "r   r   r4   6   s     I I3 Ir   c                	L    V P                   P                  V P                  4      # r6   )r-   common_project_pathr7   r9   s   &r   _gcp_project_path,GoogleSecretManagerMapping._gcp_project_path5   s    ""66t7G7GHHr   c               $    V ^8  d   QhRRRRRR/# )r   
lower_namer1   
candidates	list[str]r   r   )r   s   "r   r   r4   9   s"      # 9 Y\ r   c           	     	    \        V4      ^8X  d
   V^ ,          # VP                  4        VR,          p\        P                  ! RV RV RV R2\        ^R7       V# )   z)Secret collision: Found multiple secrets z normalizing to 'z
'. Using 'z' for case-insensitive lookup.)
stacklevel)lensortr"   warnUserWarning)r9   rD   rE   winners   &&& r   _select_case_insensitive_secret:GoogleSecretManagerMapping._select_case_insensitive_secret9   si    z?aa=  	B7
|CTU_T` aX;=		
 r   c                   V ^8  d   QhRR/# )r   r   zdict[str, str]r   )r   s   "r   r   r4   I   s      . r   c                	   / p/ pV P                   P                  V P                  R 7      pV F  pV P                   P                  VP                  4      P                  RR4      pWQV&   V P                  '       d   KP  VP                  4       pWb9  d   . W&&   W&,          P                  V4       K  	  V P                  '       g-   VP                  4        F  w  rgV P                  Wg4      W&   K  	  V# ))parentsecret )r-   list_secretsrA   parse_secret_pathnamegetr8   lowerappenditemsrP   )r9   mappingnormalized_groupssecretsrU   rY   rD   rE   s   &       r   _secret_name_map+GoogleSecretManagerMapping._secret_name_mapH   s    "$24%%22$:P:P2QF&&88EII(TVWD DM'''!ZZ\
646%1!-44T:  ###*;*A*A*C&
&*&J&J:&b# +D r   c                   V ^8  d   QhRR/# )r   r   rF   r   )r   s   "r   r   r4   `   s     2 2y 2r   c                	H    \        V P                  P                  4       4      # r6   )listra   keysr@   s   &r   _secret_names(GoogleSecretManagerMapping._secret_names_   s    D))..011r   c               $    V ^8  d   QhRRRRRR/# )r   keyr1   versionr   r   )r   s   "r   r   r4   c   s&     W W Wc W Wr   c                	N    V P                   P                  V P                  W4      # r6   )r-   secret_version_pathr7   )r9   rj   rk   s   &&&r   _secret_version_path/GoogleSecretManagerMapping._secret_version_pathc   s!    ""66t7G7GVVr   c               $    V ^8  d   QhRRRRRR/# )r   gcp_secret_namer1   rk   r   
str | Noner   )r   s   "r   r   r4   f   s"       s R\ r   c                	     V P                   P                  V P                  W4      R 7      P                  P                  P                  R4      #   \         d     R# i ; i))rY   zUTF-8N)r-   access_secret_versionrn   payloaddatadecode	Exception)r9   rq   rk   s   &&&r   _get_secret_value,GoogleSecretManagerMapping._get_secret_valuef   sX    	&&<<..H = gdd66'?+  		s   AA AAc                    V ^8  d   QhRRRR/# )r   rj   r1   r   rr   r   )r   s   "r   r   r4   n   s     ) )s )z )r   c                	   WP                   9   d   V P                   V,          # V P                  P                  V4      pVf<   V P                  '       g*   V P                  P                  VP	                  4       4      pV'       d    V P                  V4      V P                   V&   M\        V4      hV P                   V,          # r6   )r,   ra   rZ   r8   r[   ry   KeyError)r9   rj   rq   s   && r   __getitem__&GoogleSecretManagerMapping.__getitem__n   s    &&&'',,//33C8"4+?+?+?"3377		DO(,(>(>(OD  %3-##C((r   c                   V ^8  d   QhRR/# )r   r   intr   )r   s   "r   r   r4   }   s     ' ' 'r   c                	,    \        V P                  4      # r6   )rK   rg   r@   s   &r   __len__"GoogleSecretManagerMapping.__len__}   s    4%%&&r   c                   V ^8  d   QhRR/# )r   r   zIterator[str]r   )r   s   "r   r   r4      s     ( (- (r   c                	,    \        V P                  4      # r6   )iterrg   r@   s   &r   __iter__#GoogleSecretManagerMapping.__iter__   s    D&&''r   )r8   r,   r7   r-   N)latest)__name__
__module____qualname____firstlineno____annotations__r:   propertyrA   rP   r   ra   rg   rn   ry   r~   r   r   __static_attributes__r   r   r   r+   r+   +   su    **... I I  , 2 2W)'( (r   r+   c                  |   a  ] tR t^t$ R]R&   R]R&   R]R&   RR V 3R llltR	 V 3R
 lltR R ltR R ltRt	V ;t
# )!GoogleSecretManagerSettingsSourcer   _credentialsr   r-   r1   r7   c               <    V ^8  d   QhRRRRRRRRRRR	R
RRRR
RR/	# )r   settings_clsztype[BaseSettings]credentialszCredentials | Noner0   rr   
env_prefixenv_parse_none_strenv_parse_enumszbool | Noner/   z!SecretManagerServiceClient | Noner2   r   r   r   )r   s   "r   r   .GoogleSecretManagerSettingsSource.__annotate__   sd     /
 /
(/
 (/
 	/

 /
 '/
 %/
 9/
 $/
 
/
r   c	           	     	v  < \         e   \        e	   \        f   \        4        V'       d	   V'       g   \        4       w  rVf   X	pVf%   \	        X
\
        4      '       d   T
pM\        R4      hW n        W0n        V'       d   Wpn	        M\        V P                  R7      V n	        \        SV `-  VVVRVVR7       R # )Nzproject_id is required to be specified either as an argument or from the google.auth.default. See https://google-auth.readthedocs.io/en/master/reference/google.auth.html#google.auth.default)r   F)r2   r   env_ignore_emptyr   r   )r   r   r    r)   
isinstancer1   AttributeErrorr   r7   r-   superr:   )r9   r   r   r0   r   r   r   r/   r2   _credsr7   	__class__s   &&&&&&&&&  r   r:   *GoogleSecretManagerSettingsSource.__init__   s     &-1DH[Hc%' *"5"7F  K+s++(
$ T  *5 *"/"<IZIZ"[D)!"1+ 	 	
r   c               $    V ^8  d   QhRRRRRR/# )r   fieldr	   
field_namer1   r   ztuple[Any, str, bool]r   )r   s   "r   r   r      s"     ,$ ,$Y ,$C ,$DY ,$r   c                  < \        R VP                   4       R4      pV'       Ed   \        V P                  \        4      '       d   V P                  W4       F  w  rEpV P                  P                  P                  V4      pVfF   V P                  '       g4   V P                  P                  P                  VP                  4       4      pV'       g   K~  V P                  P                  Ws4      pVf   K  V P                  P                  P                  R4      '       d   WV3u # WV3u # 	  RVR3# \        SV `9  W4      w  rpV P                  P                  P                  R4      '       d	   V	e   WV3# WV3# )a  Override get_field_value to get the secret value from GCP Secret Manager.
Look for a SecretVersion metadata field to specify a particular SecretVersion.

Args:
    field: The field to get the value for
    field_name: The declared name of the field

Returns:
    A tuple of (value, key, value_is_complex), where `key` is the identifier used
    to populate the model (either the field name or an alias, depending on
    configuration).
c              3  j   "   T F)  p\        V\        4      '       g   K  VP                  x  K+  	  R # 5ir6   )r   r
   rk   ).0ms   & r   	<genexpr>DGoogleSecretManagerSettingsSource.get_field_value.<locals>.<genexpr>   s      a.QJqR_D`yqyy.s   33Npopulate_by_nameF)nextmetadatar   env_varsr+   _extract_field_infora   rZ   r2   r[   ry   r   model_configr   get_field_value)r9   r   r   secret_version	field_keyenv_namevalue_is_complexrq   env_valvalrj   
is_complexr   s   &&&         r   r   1GoogleSecretManagerSettingsSource.get_field_value   sQ    a%..acgh
 >j8RSS9=9Q9QRW9d5	%5"&--"@"@"D"DX"N"*43F3F3F&*mm&D&D&H&HIY&ZO"?"mm==o^G*  ,,99==>PQQ#*8H#HH&3CCC :e  U**$w6uI* ))--.@AAcoJ..##r   c                   V ^8  d   QhRR/# )r   r   zMapping[str, str | None]r   )r   s   "r   r   r      s     
 
 8 
r   c                	Z    \        V P                  V P                  V P                  R 7      # ))r0   r2   )r+   r-   r7   r2   r@   s   &r   _load_env_vars0GoogleSecretManagerSettingsSource._load_env_vars   s(    )D,<,<TM`M`
 	
r   c                   V ^8  d   QhRR/# r=   r   )r   s   "r   r   r      s     A A# Ar   c                	l    V P                   P                   R V P                  : RV P                  : R2# )z(project_id=z, env_nested_delimiter=))r   r   r7   env_nested_delimiterr@   s   &r   __repr__*GoogleSecretManagerSettingsSource.__repr__   s=    ..))*,t7G7G6JJabfb{b{a~~  A  	Ar   )r   r7   r-   )NNNNNNT)r   r   r   r   r   r:   r   r   r   r   __classcell__)r   s   @r   r   r      s<    ../
 /
b,$ ,$\

A Ar   r   ) 
__future__r   _annotationsr"   collections.abcr   r   	functoolsr   typingr   r   pydantic.fieldsr	   typesr
   envr   r   r   r    r!   r   r&   r   pydantic_settings.mainr   r)   r1   r+   r   __all__r   r   r   <module>r      s}    2  - % % % ! ":3E3K!%$V(cDj!9 V(rjA(9 jAZ /0L
Mr   