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
16 changes: 15 additions & 1 deletion reference/config_files/source_credentials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,26 @@ level:
{
"credentials": [
{
"url": "https://server/that/need/credentials",
"url": "https://server/that/need/credentials",
"token": "{{mytk}}"
}
]
}

In some special cases, the server might need some specific custom headers. You can also specify them using a ``headers`` dictionary.

.. code-block:: json

{
"credentials": [
{
"url": "https://server/that/need/credentials",
"token": "mytoken",
"headers": {"my-header-1": "my-value-1", "my-header-2": "my-value-2"}
}
]
}

.. note::

**Best practices**
Expand Down
9 changes: 9 additions & 0 deletions reference/extensions/authorization_plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ Here we can see an example of a plugin implementation.
elif url.startswith("https://my-private-token-sources.my-org/"):
return {'token': 'my-secure-token'}

Additionally, returning a ``headers`` dictionary will add the contents as HTTP headers for the sources request,
as some servers might need some specific custom headers:

.. code-block:: python

def auth_source_plugin(url, **kwargs):
if url.startswith("https://my-private-token-sources-with-headers.my-org/"):
return {'token': 'my-secure-token', 'headers': {'my-header-1': 'my-value-1'}}


.. note::

Expand Down