1717 JWE_ISSUED_AT ,
1818 JWE_PAYLOAD_CLIENT_ID ,
1919 JWE_PAYLOAD_CONNECTIONS ,
20+ JWE_PAYLOAD_MONITORS ,
2021 JWE_PAYLOAD_ROLES ,
2122 JWE_PAYLOAD_SCOPES ,
2223 JWE_PAYLOAD_SYSTEMS ,
3031DEFAULT_ROLES : list [str ] = []
3132DEFAULT_SYSTEMS : list [str ] = []
3233DEFAULT_CONNECTIONS : list [str ] = []
34+ DEFAULT_MONITORS : list [str ] = []
3335
3436
3537class ClientDetail (Base ):
@@ -47,6 +49,7 @@ def __tablename__(self) -> str:
4749 connections = Column (
4850 ARRAY (String ), nullable = False , server_default = "{}" , default = dict
4951 )
52+ monitors = Column (ARRAY (String ), nullable = False , server_default = "{}" , default = dict )
5053 fides_key = Column (String , index = True , unique = True , nullable = True )
5154 user_id = Column (
5255 String , ForeignKey (FidesUser .id_field_path ), nullable = True , unique = True
@@ -67,6 +70,7 @@ def create_client_and_secret(
6770 roles : list [str ] | None = None ,
6871 systems : list [str ] | None = None ,
6972 connections : list [str ] | None = None ,
73+ monitors : list [str ] | None = None ,
7074 in_memory : bool | None = False ,
7175 ) -> tuple ["ClientDetail" , str ]:
7276 """Creates a ClientDetail and returns that along with the unhashed secret
@@ -88,6 +92,9 @@ def create_client_and_secret(
8892 if not connections :
8993 connections = DEFAULT_CONNECTIONS
9094
95+ if not monitors :
96+ monitors = DEFAULT_MONITORS
97+
9198 salt = generate_salt ()
9299 hashed_secret = hash_credential_with_salt (
93100 secret .encode (encoding ),
@@ -104,6 +111,7 @@ def create_client_and_secret(
104111 "roles" : roles ,
105112 "systems" : systems ,
106113 "connections" : connections ,
114+ "monitors" : monitors ,
107115 }
108116
109117 if in_memory :
@@ -142,6 +150,7 @@ def create_access_code_jwe(self, encryption_key: str) -> str:
142150 JWE_PAYLOAD_ROLES : self .roles ,
143151 JWE_PAYLOAD_SYSTEMS : self .systems ,
144152 JWE_PAYLOAD_CONNECTIONS : self .connections ,
153+ JWE_PAYLOAD_MONITORS : self .monitors ,
145154 }
146155 return generate_jwe (json .dumps (payload ), encryption_key )
147156
@@ -176,6 +185,7 @@ def _get_root_client_detail(
176185 roles = roles ,
177186 systems = [],
178187 connections = [],
188+ monitors = [],
179189 )
180190
181191 return ClientDetail (
@@ -186,4 +196,5 @@ def _get_root_client_detail(
186196 roles = DEFAULT_ROLES ,
187197 systems = DEFAULT_SYSTEMS ,
188198 connections = DEFAULT_CONNECTIONS ,
199+ monitors = DEFAULT_MONITORS ,
189200 )
0 commit comments