Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 58 additions & 2 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,61 @@
# Release Notes

## 2.0.1

### Behavior Change

Auth validation now expects the platform auth envelope only. Flat auth is no
longer accepted. Production runtime behavior is unchanged (the platform has
always sent the envelope); this release fixes the SDK to validate the object
production actually sends. Local tests and scripts that construct flat auth
contexts must migrate to the wrapped shape.

The platform delivers integration auth as a wrapped envelope:

```json
{"auth_type": "Custom", "credentials": {"api_key": "...", "api_url": "..."}}
```

The `auth.fields` schema in `config.json` describes the inner `credentials`
object. Previously the SDK validated the *entire* envelope against
`auth.fields`, so any non-empty `required` list failed before the handler ran
(the ActiveCampaign outage), while an empty `required` list passed vacuously
even with empty credentials.

As of 2.0.1 the SDK validates only `context.auth["credentials"]` against
`auth.fields`. `auth.fields.required` is now honoured and recommended. If
`context.auth` is not a wrapped envelope with a `credentials` dict, validation
fails with a `VALIDATION_ERROR` whose `source` is `"auth"`.

**Before (2.x local test):**
```python
ctx = ExecutionContext(auth={"api_key": "..."}) # flat
```

**After (2.0.1):**
```python
ctx = ExecutionContext(auth={"auth_type": "Custom", "credentials": {"api_key": "..."}})
```

### Migration Guide

1. **Wrap auth in local tests and any manual `ExecutionContext` construction**
in the `{"auth_type": ..., "credentials": {...}}` envelope. Production
traffic is already wrapped by the platform.
2. **Read credentials directly from the envelope** via
`context.auth["credentials"]`:
```python
# Before
api_key = context.auth.get("api_key", "")
# After
api_key = context.auth["credentials"].get("api_key", "")
```
3. **Keep `auth.fields.required`** — it is now enforced against the credentials
object and is the recommended way to require credentials.
4. **Note on pins:** `~=2.0.0` pins resolve to 2.0.1 automatically on the next
rebuild; there is no flat-auth backward compatibility, so migrate tests
before rebuilding. Pin `~=2.0.1` to express the requirement explicitly.

## 2.0.0

### ⚠️ Breaking Change
Expand Down Expand Up @@ -68,7 +124,7 @@ items = response.data["results"]

- Missed version update in init file.

## 1.0.0
## 1.0.0
- Add ActionResult and IntegrationResult classes to provide standardized result handling with optional billing/cost tracking capabilities for the integrations SDK
- Introduce SDK support for connected account information so integrations can expose the authorized user's identity; add documentation and public exports.

Expand Down Expand Up @@ -100,4 +156,4 @@ items = response.data["results"]
- Module structure changes

## 0.0.1
- Initial Release
- Initial Release
6 changes: 3 additions & 3 deletions docs/apidocs/autohive_integrations_sdk.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,18 @@ <h2>API Documentation</h2>
<h1 class="modulename">
autohive_integrations_sdk </h1>


<input id="mod-autohive_integrations_sdk-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1">

<label class="view-source-button" for="mod-autohive_integrations_sdk-view-source"><span>View Source</span></label>

<div class="pdoc-code codehilite"><pre><span></span><span id="L-1"><a href="#L-1"><span class="linenos">1</span></a><span class="c1"># Version</span>
</span><span id="L-2"><a href="#L-2"><span class="linenos">2</span></a><span class="n">__version__</span> <span class="o">=</span> <span class="s2">&quot;2.0.0&quot;</span>
</span><span id="L-2"><a href="#L-2"><span class="linenos">2</span></a><span class="n">__version__</span> <span class="o">=</span> <span class="s2">&quot;3.0.0.dev0&quot;</span>
</span><span id="L-3"><a href="#L-3"><span class="linenos">3</span></a>
</span><span id="L-4"><a href="#L-4"><span class="linenos">4</span></a><span class="c1"># Re-export classes from integration module</span>
</span><span id="L-5"><a href="#L-5"><span class="linenos">5</span></a><span class="kn">from</span><span class="w"> </span><span class="nn">autohive_integrations_sdk.integration</span><span class="w"> </span><span class="kn">import</span> <span class="p">(</span>
</span><span id="L-6"><a href="#L-6"><span class="linenos">6</span></a> <span class="n">Integration</span><span class="p">,</span> <span class="n">ExecutionContext</span><span class="p">,</span> <span class="n">ActionHandler</span><span class="p">,</span> <span class="n">PollingTriggerHandler</span><span class="p">,</span> <span class="n">ConnectedAccountHandler</span><span class="p">,</span>
</span><span id="L-7"><a href="#L-7"><span class="linenos">7</span></a> <span class="n">ConnectedAccountInfo</span><span class="p">,</span> <span class="n">ValidationError</span><span class="p">,</span> <span class="n">HTTPError</span><span class="p">,</span> <span class="n">RateLimitError</span><span class="p">,</span>
</span><span id="L-7"><a href="#L-7"><span class="linenos">7</span></a> <span class="n">ConnectedAccountInfo</span><span class="p">,</span> <span class="n">ValidationError</span><span class="p">,</span> <span class="n">HTTPError</span><span class="p">,</span> <span class="n">RateLimitError</span><span class="p">,</span>
</span><span id="L-8"><a href="#L-8"><span class="linenos">8</span></a> <span class="n">ActionResult</span><span class="p">,</span> <span class="n">ActionError</span><span class="p">,</span> <span class="n">IntegrationResult</span><span class="p">,</span> <span class="n">ResultType</span><span class="p">,</span> <span class="n">FetchResponse</span>
</span><span id="L-9"><a href="#L-9"><span class="linenos">9</span></a><span class="p">)</span>
</span></pre></div>
Expand Down
Loading
Loading