---
title: Refresh Quarto Content
date: 2024-07-02
author: Taylor Steinberg
---

This Python script checks for Quarto content with an "out-of-date" version based on the logic defined in the `out_of_date` method. In this case, the logic coincides with the Quarto patches to address the [Polyfill supply chain attack](https://snyk.io/blog/polyfill-supply-chain-attack-js-cdn-assets/).

Quarto has released patches 1.4.557 and 1.5.52. A patch for version 1.3.x is forthcoming.

After installing the latest available versions of Quarto to Connect, execute this script to refresh each piece of out-of-date Quarto content synchronously.

The user assumed by the API key used must have admin permissions. When the assumed user cannot access content, a temporary permission is created to execute the content refresh. Once the refresh is complete, the temporary permission is removed. This action is recorded in the Connect audit logs. Note that the content is not downloaded or otherwise accessed by the assumed user.

```bash
pip install posit-sdk
CONNECT_API_KEY=your-api-key CONNECT_SERVER=https://connect.example.com python main.py
```

```python
#filename: main.py
{{< include main.py >}}
```

### Example output

```text
Found 173 items to update...
Content https://connect.example.com/connect/#/apps/7e101388-b69e-462c-a6ed-3fcd0d415601 set to Quarto 1.4.549...
Creating temporary permission...
Refreshing 'https://connect.example.com/connect/#/apps/7e101388-b69e-462c-a6ed-3fcd0d415601'
Successfully refreshed 'https://connect.example.com/connect/#/apps/7e101388-b69e-462c-a6ed-3fcd0d415601'
Removing temporary permission...
```
