Skip to content

ark_dpa_sso_service

ArkDPASSOService

Bases: ArkService

Source code in ark_sdk_python/services/dpa/sso/ark_dpa_sso_service.py
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
class ArkDPASSOService(ArkService):
    def __init__(self, isp_auth: ArkISPAuth) -> None:
        super().__init__(isp_auth)
        self.__isp_auth = isp_auth
        self.__client: ArkISPServiceClient = ArkISPServiceClient.from_isp_auth(self.__isp_auth, 'dpa')
        self.__cache_keyring = ArkKeyring(self.service_config().service_name)

    def __load_from_cache(self, token_type: str) -> Optional[ArkDPASSOAcquireTokenResponse]:
        claims = get_unverified_claims(self.__client.session_token)
        token = self.__cache_keyring.load_token(
            ArkProfileLoader.load_default_profile(),
            postfix=f'{claims["tenant_id"]}_{claims["unique_name"]}_dpa_sso_short_lived_{token_type}',
        )
        if token:
            return ArkDPASSOAcquireTokenResponse.parse_raw(token.token.get_secret_value())
        return None

    def __save_to_cache(self, result: ArkDPASSOAcquireTokenResponse, token_type: str) -> None:
        claims = get_unverified_claims(self.__client.session_token)
        expires_in = datetime.now() + (parse(result.metadata['expires_at']) - parse(result.metadata['created_at']))
        self.__cache_keyring.save_token(
            ArkProfileLoader.load_default_profile(),
            ArkToken(
                token=result.json(),
                token_type=ArkTokenType.Token,
                expires_in=expires_in,
            ),
            postfix=f'{claims["tenant_id"]}_{claims["unique_name"]}_dpa_sso_short_lived_{token_type}',
        )

    def __expand_folder(self, folder: str) -> str:
        folder_path = os.path.expanduser(folder)
        if not folder_path.endswith('/'):
            folder_path += '/'
        return folder_path

    def __output_client_certificate(
        self, folder: str, output_format: ArkDPASSOShortLiveClientCertificateFormat, result: ArkDPASSOAcquireTokenResponse
    ) -> None:
        folder_path = self.__expand_folder(folder)
        claims = get_unverified_claims(self.__client.session_token)
        base_name = claims["unique_name"].split('@')[0]
        client_certificate = result.token['client_certificate']
        private_key = result.token['private_key']

        if output_format == ArkDPASSOShortLiveClientCertificateFormat.RAW:
            ArkArgsFormatter.print_normal(f'client-certificate-data: {client_certificate}')
            ArkArgsFormatter.print_normal(f'client-key-data: {private_key}')
        elif output_format == ArkDPASSOShortLiveClientCertificateFormat.BASE64:
            ArkArgsFormatter.print_normal(
                f'client-certificate-data: {base64.b64encode(client_certificate.encode("utf-8")).decode("utf-8")}'
            )
            ArkArgsFormatter.print_normal(f'client-key-data: {base64.b64encode(private_key.encode("utf-8")).decode("utf-8")}')
        elif output_format == ArkDPASSOShortLiveClientCertificateFormat.FILE:
            if not folder_path:
                raise ArkServiceException(
                    f'Folder parameter is required if format is {ArkDPASSOShortLiveClientCertificateFormat.FILE.value}'
                )
            if not os.path.exists(folder_path):
                os.makedirs(folder_path)
            with open(f'{folder_path}{os.path.sep}{base_name}_client_cert.crt', 'w', encoding='utf-8') as file_handle:
                file_handle.write(client_certificate)
            with open(f'{folder_path}{os.path.sep}{base_name}_client_key.pem', 'w', encoding='utf-8') as file_handle:
                file_handle.write(private_key)
        elif output_format == ArkDPASSOShortLiveClientCertificateFormat.SINGLE_FILE:
            if not folder:
                raise ArkServiceException(
                    f'Folder parameter is required if format is {ArkDPASSOShortLiveClientCertificateFormat.FILE.value}'
                )
            if not os.path.exists(folder_path):
                os.makedirs(folder_path)
            with open(f'{folder_path}{os.path.sep}{base_name}_client_cert.pem', 'w', encoding='utf-8') as file_handle:
                file_handle.write(client_certificate)
                file_handle.write('\n')
                file_handle.write(private_key)
        else:
            raise ArkServiceException(f'Unknown format {output_format}')

    def __save_oracle_sso_wallet(self, folder: str, unzip_wallet: bool, result: ArkDPASSOAcquireTokenResponse) -> None:
        folder_path = self.__expand_folder(folder)
        result.token['wallet'] = base64.b64decode(result.token['wallet'])
        if not os.path.exists(folder_path):
            os.makedirs(folder_path)
        if not unzip_wallet:
            claims = get_unverified_claims(self.__client.session_token)
            base_name = claims["unique_name"].split('@')[0]
            with open(f'{folder_path}{os.path.sep}{base_name}_wallet.zip', 'wb') as file_handle:
                file_handle.write(result.token['wallet'])
        else:
            wallet_bytes = BytesIO(result.token['wallet'])
            with zipfile.ZipFile(wallet_bytes, 'r') as zipf:
                zipf.extractall(folder_path)

    def __save_oracle_pem_wallet(self, folder: str, result: ArkDPASSOAcquireTokenResponse) -> None:
        folder_path = self.__expand_folder(folder)
        claims = get_unverified_claims(self.__client.session_token)
        base_name = claims["unique_name"].split('@')[0]
        pem_wallet = base64.b64decode(result.token['pem_wallet']).decode('utf-8')
        if not os.path.exists(folder_path):
            os.makedirs(folder_path)
        with open(f'{folder_path}{os.path.sep}{base_name}_ewallet.pem', 'w', encoding='utf-8') as file_handle:
            file_handle.write(pem_wallet)

    def __save_rdp_file(self, get_short_lived_rdp_file: ArkDPASSOGetShortLivedRDPFile, result: ArkDPASSOAcquireTokenResponse) -> None:
        folder_path = self.__expand_folder(get_short_lived_rdp_file.folder)
        if not os.path.exists(folder_path):
            os.makedirs(folder_path)
        filename: str = f'dpa _a {get_short_lived_rdp_file.target_address}'
        if get_short_lived_rdp_file.target_domain:
            filename += f' _d {get_short_lived_rdp_file.target_domain}'
        with open(f'{folder_path}{filename}.rdp', 'w', encoding='utf-8') as file_handle:
            file_handle.write(result.token['text'])

    def short_lived_password(self, get_short_lived_password: ArkDPASSOGetShortLivedPassword) -> str:
        """
        Generates a short-lived password used to connect to DPA services.

        Args:
            get_short_lived_password (ArkDPASSOGetShortLivedPassword): _description_

        Raises:
            ArkServiceException: _description_

        Returns:
            str: __description__
        """
        self._logger.info('Generating short lived password token')
        if get_short_lived_password.allow_caching:
            result = self.__load_from_cache('password')
            if result:
                return result.token['key']
        response: Response = self.__client.post(
            ACQUIRE_SSO_TOKEN_URL,
            json={
                'token_type': 'password',
                'service': 'DPA-DB',
            },
        )
        if response.status_code != HTTPStatus.CREATED:
            raise ArkServiceException(f'Failed to generate short lived password - [{response.status_code}] - [{response.text}]')
        result: ArkDPASSOAcquireTokenResponse = ArkDPASSOAcquireTokenResponse.parse_obj(response.json())
        if 'key' in result.token:
            if get_short_lived_password.allow_caching:
                self.__save_to_cache(result, 'password')
            return result.token['key']
        raise ArkServiceException(f'Failed to generate short lived password - [{response.status_code}] - [{response.text}]')

    def short_lived_client_certificate(self, get_short_lived_client_certificate: ArkDPASSOGetShortLivedClientCertificate) -> None:
        """
        Generates a short-lived client certificate used to connect to DPA services.

        Args:
            get_short_lived_client_certificate (ArkDPASSOGetShortLivedClientCertificate): _description_

        Raises:
            ArkServiceException: _description_

        Returns:
            str: __description__
        """
        self._logger.info('Generating short lived client certificate')
        if get_short_lived_client_certificate.allow_caching:
            result = self.__load_from_cache('client_certificate')
            if result:
                self.__output_client_certificate(
                    get_short_lived_client_certificate.folder, get_short_lived_client_certificate.output_format, result
                )
                return
        response: Response = self.__client.post(
            ACQUIRE_SSO_TOKEN_URL,
            json={
                'token_type': 'client_certificate',
                'service': get_short_lived_client_certificate.service,
            },
        )
        if response.status_code != HTTPStatus.CREATED:
            raise ArkServiceException(f'Failed to generate short lived client certificate - [{response.status_code}] - [{response.text}]')
        result: ArkDPASSOAcquireTokenResponse = ArkDPASSOAcquireTokenResponse.parse_obj(response.json())
        if 'client_certificate' in result.token and 'private_key' in result.token:
            if get_short_lived_client_certificate.allow_caching:
                self.__save_to_cache(result, 'client_certificate')
            self.__output_client_certificate(
                get_short_lived_client_certificate.folder, get_short_lived_client_certificate.output_format, result
            )
            return
        raise ArkServiceException(f'Failed to generate short lived password - [{response.status_code}] - [{response.text}]')

    def short_lived_oracle_wallet(self, get_short_lived_oracle_wallet: ArkDPASSOGetShortLivedOracleWallet) -> None:
        """
        Generates a short-lived Oracle Wallet used to connect via DPA to Oracle databases.

        Args:
            get_short_lived_oracle_wallet (ArkDPASSOGetShortLivedOracleWallet): _description_

        Raises:
            ArkServiceException: _description_

        Returns:
            str: __description__
        """
        self._logger.info('Generating short lived oracle wallet')
        if get_short_lived_oracle_wallet.allow_caching:
            result = self.__load_from_cache('oracle_wallet')
            if result:
                if get_short_lived_oracle_wallet.wallet_type == ArkDPASSOShortLivedOracleWalletType.SSO:
                    self.__save_oracle_sso_wallet(get_short_lived_oracle_wallet.folder, get_short_lived_oracle_wallet.unzip_wallet, result)
                if get_short_lived_oracle_wallet.wallet_type == ArkDPASSOShortLivedOracleWalletType.PEM:
                    self.__save_oracle_pem_wallet(get_short_lived_oracle_wallet.folder, get_short_lived_oracle_wallet.unzip_wallet, result)
                return
        response: Response = self.__client.post(
            ACQUIRE_SSO_TOKEN_URL,
            json={
                'token_type': 'oracle_wallet',
                'service': 'DPA-DB',
                'token_parameters': {
                    'walletType': get_short_lived_oracle_wallet.wallet_type.value,
                },
            },
        )
        if response.status_code != HTTPStatus.CREATED:
            raise ArkServiceException(f'Failed to generate short lived oracle wallet - [{response.status_code}] - [{response.text}]')
        result: ArkDPASSOAcquireTokenResponse = ArkDPASSOAcquireTokenResponse.parse_obj(response.json())
        if 'wallet' in result.token and get_short_lived_oracle_wallet.wallet_type == ArkDPASSOShortLivedOracleWalletType.SSO:
            if get_short_lived_oracle_wallet.allow_caching:
                self.__save_to_cache(result, 'oracle_wallet')
            self.__save_oracle_sso_wallet(get_short_lived_oracle_wallet.folder, get_short_lived_oracle_wallet.unzip_wallet, result)
            return
        elif 'pem_wallet' in result.token and get_short_lived_oracle_wallet.wallet_type == ArkDPASSOShortLivedOracleWalletType.PEM:
            if get_short_lived_oracle_wallet.allow_caching:
                self.__save_to_cache(result, 'oracle_wallet')
            self.__save_oracle_pem_wallet(get_short_lived_oracle_wallet.folder, result)
            return
        raise ArkServiceException(f'Failed to generate short lived password - [{response.status_code}] - [{response.text}]')

    def short_lived_rdp_file(self, get_short_lived_rdp_file: ArkDPASSOGetShortLivedRDPFile) -> None:
        """
        Generates a short-lived RDP file used to connect via RDP to Windows machines.

        Args:
            get_short_lived_rdp_file (ArkDPASSOGetShortLivedRDPFile): _description_

        Raises:
            ArkServiceException: _description_

        Returns:
            str: __description__
        """
        self._logger.info('Generating short lived rdp file')
        if get_short_lived_rdp_file.allow_caching:
            result = self.__load_from_cache('rdp_file')
            if result:
                self.__save_rdp_file(get_short_lived_rdp_file, result)
        token_parameters: Dict[str, Any] = {
            'targetAddress': get_short_lived_rdp_file.target_address,
            'targetDomain': get_short_lived_rdp_file.target_domain,
            'targetUser': get_short_lived_rdp_file.target_user,
            'elevatedPrivileges': get_short_lived_rdp_file.elevated_privileges,
        }
        response: Response = self.__client.post(
            ACQUIRE_SSO_TOKEN_URL,
            json={
                'token_type': 'rdp_file',
                'service': 'DPA-RDP',
                'token_parameters': {k: v for k, v in token_parameters.items() if v is not None},
                'token_response_format': 'extended',
            },
        )
        if response.status_code != HTTPStatus.CREATED:
            raise ArkServiceException(f'Failed to generate short lived rdp file - [{response.status_code}] - [{response.text}]')
        result: ArkDPASSOAcquireTokenResponse = ArkDPASSOAcquireTokenResponse.parse_obj(response.json())
        if 'text' in result.token:
            if get_short_lived_rdp_file.allow_caching:
                self.__save_to_cache(result, 'rdp_file')
            self.__save_rdp_file(get_short_lived_rdp_file, result)
            return
        raise ArkServiceException(f'Failed to generate short rdp file - [{response.status_code}] - [{response.text}]')

    @staticmethod
    @overrides
    def service_config() -> ArkServiceConfig:
        return SERVICE_CONFIG

short_lived_client_certificate(get_short_lived_client_certificate)

Generates a short-lived client certificate used to connect to DPA services.

Parameters:

Name Type Description Default
get_short_lived_client_certificate ArkDPASSOGetShortLivedClientCertificate

description

required

Raises:

Type Description
ArkServiceException

description

Returns:

Name Type Description
str None

description

Source code in ark_sdk_python/services/dpa/sso/ark_dpa_sso_service.py
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
def short_lived_client_certificate(self, get_short_lived_client_certificate: ArkDPASSOGetShortLivedClientCertificate) -> None:
    """
    Generates a short-lived client certificate used to connect to DPA services.

    Args:
        get_short_lived_client_certificate (ArkDPASSOGetShortLivedClientCertificate): _description_

    Raises:
        ArkServiceException: _description_

    Returns:
        str: __description__
    """
    self._logger.info('Generating short lived client certificate')
    if get_short_lived_client_certificate.allow_caching:
        result = self.__load_from_cache('client_certificate')
        if result:
            self.__output_client_certificate(
                get_short_lived_client_certificate.folder, get_short_lived_client_certificate.output_format, result
            )
            return
    response: Response = self.__client.post(
        ACQUIRE_SSO_TOKEN_URL,
        json={
            'token_type': 'client_certificate',
            'service': get_short_lived_client_certificate.service,
        },
    )
    if response.status_code != HTTPStatus.CREATED:
        raise ArkServiceException(f'Failed to generate short lived client certificate - [{response.status_code}] - [{response.text}]')
    result: ArkDPASSOAcquireTokenResponse = ArkDPASSOAcquireTokenResponse.parse_obj(response.json())
    if 'client_certificate' in result.token and 'private_key' in result.token:
        if get_short_lived_client_certificate.allow_caching:
            self.__save_to_cache(result, 'client_certificate')
        self.__output_client_certificate(
            get_short_lived_client_certificate.folder, get_short_lived_client_certificate.output_format, result
        )
        return
    raise ArkServiceException(f'Failed to generate short lived password - [{response.status_code}] - [{response.text}]')

short_lived_oracle_wallet(get_short_lived_oracle_wallet)

Generates a short-lived Oracle Wallet used to connect via DPA to Oracle databases.

Parameters:

Name Type Description Default
get_short_lived_oracle_wallet ArkDPASSOGetShortLivedOracleWallet

description

required

Raises:

Type Description
ArkServiceException

description

Returns:

Name Type Description
str None

description

Source code in ark_sdk_python/services/dpa/sso/ark_dpa_sso_service.py
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
def short_lived_oracle_wallet(self, get_short_lived_oracle_wallet: ArkDPASSOGetShortLivedOracleWallet) -> None:
    """
    Generates a short-lived Oracle Wallet used to connect via DPA to Oracle databases.

    Args:
        get_short_lived_oracle_wallet (ArkDPASSOGetShortLivedOracleWallet): _description_

    Raises:
        ArkServiceException: _description_

    Returns:
        str: __description__
    """
    self._logger.info('Generating short lived oracle wallet')
    if get_short_lived_oracle_wallet.allow_caching:
        result = self.__load_from_cache('oracle_wallet')
        if result:
            if get_short_lived_oracle_wallet.wallet_type == ArkDPASSOShortLivedOracleWalletType.SSO:
                self.__save_oracle_sso_wallet(get_short_lived_oracle_wallet.folder, get_short_lived_oracle_wallet.unzip_wallet, result)
            if get_short_lived_oracle_wallet.wallet_type == ArkDPASSOShortLivedOracleWalletType.PEM:
                self.__save_oracle_pem_wallet(get_short_lived_oracle_wallet.folder, get_short_lived_oracle_wallet.unzip_wallet, result)
            return
    response: Response = self.__client.post(
        ACQUIRE_SSO_TOKEN_URL,
        json={
            'token_type': 'oracle_wallet',
            'service': 'DPA-DB',
            'token_parameters': {
                'walletType': get_short_lived_oracle_wallet.wallet_type.value,
            },
        },
    )
    if response.status_code != HTTPStatus.CREATED:
        raise ArkServiceException(f'Failed to generate short lived oracle wallet - [{response.status_code}] - [{response.text}]')
    result: ArkDPASSOAcquireTokenResponse = ArkDPASSOAcquireTokenResponse.parse_obj(response.json())
    if 'wallet' in result.token and get_short_lived_oracle_wallet.wallet_type == ArkDPASSOShortLivedOracleWalletType.SSO:
        if get_short_lived_oracle_wallet.allow_caching:
            self.__save_to_cache(result, 'oracle_wallet')
        self.__save_oracle_sso_wallet(get_short_lived_oracle_wallet.folder, get_short_lived_oracle_wallet.unzip_wallet, result)
        return
    elif 'pem_wallet' in result.token and get_short_lived_oracle_wallet.wallet_type == ArkDPASSOShortLivedOracleWalletType.PEM:
        if get_short_lived_oracle_wallet.allow_caching:
            self.__save_to_cache(result, 'oracle_wallet')
        self.__save_oracle_pem_wallet(get_short_lived_oracle_wallet.folder, result)
        return
    raise ArkServiceException(f'Failed to generate short lived password - [{response.status_code}] - [{response.text}]')

short_lived_password(get_short_lived_password)

Generates a short-lived password used to connect to DPA services.

Parameters:

Name Type Description Default
get_short_lived_password ArkDPASSOGetShortLivedPassword

description

required

Raises:

Type Description
ArkServiceException

description

Returns:

Name Type Description
str str

description

Source code in ark_sdk_python/services/dpa/sso/ark_dpa_sso_service.py
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
def short_lived_password(self, get_short_lived_password: ArkDPASSOGetShortLivedPassword) -> str:
    """
    Generates a short-lived password used to connect to DPA services.

    Args:
        get_short_lived_password (ArkDPASSOGetShortLivedPassword): _description_

    Raises:
        ArkServiceException: _description_

    Returns:
        str: __description__
    """
    self._logger.info('Generating short lived password token')
    if get_short_lived_password.allow_caching:
        result = self.__load_from_cache('password')
        if result:
            return result.token['key']
    response: Response = self.__client.post(
        ACQUIRE_SSO_TOKEN_URL,
        json={
            'token_type': 'password',
            'service': 'DPA-DB',
        },
    )
    if response.status_code != HTTPStatus.CREATED:
        raise ArkServiceException(f'Failed to generate short lived password - [{response.status_code}] - [{response.text}]')
    result: ArkDPASSOAcquireTokenResponse = ArkDPASSOAcquireTokenResponse.parse_obj(response.json())
    if 'key' in result.token:
        if get_short_lived_password.allow_caching:
            self.__save_to_cache(result, 'password')
        return result.token['key']
    raise ArkServiceException(f'Failed to generate short lived password - [{response.status_code}] - [{response.text}]')

short_lived_rdp_file(get_short_lived_rdp_file)

Generates a short-lived RDP file used to connect via RDP to Windows machines.

Parameters:

Name Type Description Default
get_short_lived_rdp_file ArkDPASSOGetShortLivedRDPFile

description

required

Raises:

Type Description
ArkServiceException

description

Returns:

Name Type Description
str None

description

Source code in ark_sdk_python/services/dpa/sso/ark_dpa_sso_service.py
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
def short_lived_rdp_file(self, get_short_lived_rdp_file: ArkDPASSOGetShortLivedRDPFile) -> None:
    """
    Generates a short-lived RDP file used to connect via RDP to Windows machines.

    Args:
        get_short_lived_rdp_file (ArkDPASSOGetShortLivedRDPFile): _description_

    Raises:
        ArkServiceException: _description_

    Returns:
        str: __description__
    """
    self._logger.info('Generating short lived rdp file')
    if get_short_lived_rdp_file.allow_caching:
        result = self.__load_from_cache('rdp_file')
        if result:
            self.__save_rdp_file(get_short_lived_rdp_file, result)
    token_parameters: Dict[str, Any] = {
        'targetAddress': get_short_lived_rdp_file.target_address,
        'targetDomain': get_short_lived_rdp_file.target_domain,
        'targetUser': get_short_lived_rdp_file.target_user,
        'elevatedPrivileges': get_short_lived_rdp_file.elevated_privileges,
    }
    response: Response = self.__client.post(
        ACQUIRE_SSO_TOKEN_URL,
        json={
            'token_type': 'rdp_file',
            'service': 'DPA-RDP',
            'token_parameters': {k: v for k, v in token_parameters.items() if v is not None},
            'token_response_format': 'extended',
        },
    )
    if response.status_code != HTTPStatus.CREATED:
        raise ArkServiceException(f'Failed to generate short lived rdp file - [{response.status_code}] - [{response.text}]')
    result: ArkDPASSOAcquireTokenResponse = ArkDPASSOAcquireTokenResponse.parse_obj(response.json())
    if 'text' in result.token:
        if get_short_lived_rdp_file.allow_caching:
            self.__save_to_cache(result, 'rdp_file')
        self.__save_rdp_file(get_short_lived_rdp_file, result)
        return
    raise ArkServiceException(f'Failed to generate short rdp file - [{response.status_code}] - [{response.text}]')