feat(platform): Support multiple credentials inputs on blocks (#8932)

- Resolves #8930
- Depends on #8725

### Changes 🏗️

- feat(platform): Support multiple credentials inputs on blocks

Aside from `credentials`, fields within the name pattern `*_credentials`
are now also supported!

- Update docs with info on multi credentials support

### Checklist 📋

#### For code changes:
- [x] I have clearly listed my changes in the PR description
- [x] I have made a test plan
- [x] I have tested my changes according to the test plan:
  - [x] Ask @aarushik93 to test
This commit is contained in:
Reinier van der Leer
2025-01-03 16:18:57 +01:00
committed by GitHub
parent 84af37a27a
commit 1375a0fdbc
10 changed files with 207 additions and 127 deletions

View File

@@ -238,6 +238,16 @@ Naturally, to add an authenticated block for a new provider, you'll have to add
```
</details>
#### Multiple credentials inputs
Multiple credentials inputs are supported, under the following conditions:
- The name of each of the credentials input fields must end with `_credentials`.
- The names of the credentials input fields must match the names of the corresponding
parameters on the `run(..)` method of the block.
- If more than one of the credentials parameters are required, `test_credentials`
is a `dict[str, Credentials]`, with for each required credentials input the
parameter name as the key and suitable test credentials as the value.
#### Adding an OAuth2 service integration
To add support for a new OAuth2-authenticated service, you'll need to add an `OAuthHandler`.