Skip to content
Closed
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Install tiled
run: uv sync --all-extras
run: uv sync --all-extras --with "bluesky-authentication @ git+https://github.com/davidpcls/bluesky-authentication.git@main"

# TODO Find a new image to use.
# https://github.com/bluesky/tiled/issues/1109
Expand Down Expand Up @@ -128,7 +128,7 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Install tiled
run: uv sync --all-extras
run: uv sync --all-extras --with "bluesky-authentication @ git+https://github.com/davidpcls/bluesky-authentication.git@main"
env:
TILED_BUILD_SKIP_UI: 1

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Install tiled
run: uv sync --all-extras --group docs
run: uv sync --all-extras --group docs --with "bluesky-authentication @ git+https://github.com/davidpcls/bluesky-authentication.git@main"

- name: Build Docs
shell: bash -l {0}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Install tiled
run: uv sync --all-extras --group docs
run: uv sync --all-extras --group docs --with "bluesky-authentication @ git+https://github.com/davidpcls/bluesky-authentication.git@main"

- name: Build Docs
shell: bash -l {0}
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ on the `conda-forge` channel, which pixi uses by default.

See [Getting Started][] for more detailed installation instructions.


## First Steps

See [What is Tiled?][] for an overview of Tiled's goals. Then see
Expand Down
12 changes: 8 additions & 4 deletions config.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@
# Authentication
# -----------------------------------------------------------------------------
authentication:
# Canonical authenticator import path:
# bluesky_authentication.authenticators:ClassName
# Backward-compatible legacy path still supported:
# tiled.authenticators:ClassName

# ---------------------------------------------------------------------------
# Identity Providers
Expand All @@ -176,7 +180,7 @@ authentication:
#
# providers:
# - provider: local
# authenticator: tiled.authenticators:PAMAuthenticator
# authenticator: bluesky_authentication.authenticators:PAMAuthenticator
# args:
# service: login # PAM service name. Default is "login".

Expand All @@ -200,7 +204,7 @@ authentication:
#
# providers:
# - provider: google # Must match the label used in the redirect URIs above
# authenticator: tiled.authenticators:OIDCAuthenticator
# authenticator: bluesky_authentication.authenticators:OIDCAuthenticator
# args:
# audience: tiled # Checked against the "aud" claim in the token
# client_id: YOUR_CLIENT_ID_HERE
Expand All @@ -226,7 +230,7 @@ authentication:
#
# providers:
# - provider: toy
# authenticator: tiled.authenticators:DictionaryAuthenticator
# authenticator: bluesky_authentication.authenticators:DictionaryAuthenticator
# args:
# users_to_passwords:
# alice: ${ALICE_PASSWORD}
Expand All @@ -239,7 +243,7 @@ authentication:
#
# providers:
# - provider: toy
# authenticator: tiled.authenticators:DummyAuthenticator
# authenticator: bluesky_authentication.authenticators:DummyAuthenticator


# ---------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def parse_schema(d, md=[], depth=0, pre=""):
providers=[
AuthenticationProviderSpec(
provider="dummy",
authenticator="tiled.authenticators:DummyAuthenticator",
authenticator="bluesky_authentication.authenticators:DummyAuthenticator",
)
]
),
Expand Down
14 changes: 9 additions & 5 deletions docs/source/explanations/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ Tiled is designed to integrate with external user-management systems via a plugg
Authenticator interface. For those familiar with JupyterHub, these are very
similar to JupyterHub Authenticators. Authenticators fall into two groups:

The canonical import path for built-in authenticators is
`bluesky_authentication.authenticators:*`. For backward compatibility,
`tiled.authenticators:*` remains supported for existing configurations.

* Authenticators that accept user credentials directly, following the OAuth2 and
OpenAPI standards as shown below, and validate the credentials using some
underlying authentication mechanism, such as PAM.
Expand Down Expand Up @@ -176,7 +180,7 @@ The configuration file(s) should include:

```yaml
authentication:
authenticator: tiled.authenticators:PAMAuthenticator
authenticator: bluesky_authentication.authenticators:PAMAuthenticator
```

Here is a complete working example:
Expand All @@ -185,7 +189,7 @@ Here is a complete working example:
# pam_config.yml
authentication:
providers:
- authenticator: tiled.authenticators:PAMAuthenticator
- authenticator: bluesky_authentication.authenticators:PAMAuthenticator
# This 'provider' can be any string; it is used to differentiate
# authentication providers when multiple ones are supported.
provider: local
Expand Down Expand Up @@ -251,7 +255,7 @@ The configuration file(s) must include the following.
authentication:
providers:
- provider: example.com
authenticator: tiled.authenticators:OIDCAuthenticator
authenticator: bluesky_authentication.authenticators:OIDCAuthenticator
args:
# Values should come from your OIDC provider configuration
# The audience claim is checked by the OIDC Client (Tiled)
Expand Down Expand Up @@ -282,7 +286,7 @@ should only for used for development and demos.
authentication:
providers:
- provider: toy
authenticator: tiled.authenticators:DictionaryAuthenticator
authenticator: bluesky_authentication.authenticators:DictionaryAuthenticator
args:
users_to_passwords:
alice: ${ALICE_PASSWORD}
Expand All @@ -304,7 +308,7 @@ The ``DummyAuthenticator`` accepts *any* username and password combination.
authentication:
providers:
- provider: toy
authenticator: tiled.authenticators:DummyAuthenticator
authenticator: bluesky_authentication.authenticators:DummyAuthenticator
trees:
- path: /
tree: tiled.examples.generated_minimal:tree
Expand Down
2 changes: 1 addition & 1 deletion example_configs/external_service/custom.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy
from bluesky_authentication.protocols import UserSessionState

from tiled.adapters.array import ArrayAdapter
from tiled.authenticators import UserSessionState
from tiled.server.protocols import InternalAuthenticator
from tiled.structures.core import StructureFamily

Expand Down
2 changes: 1 addition & 1 deletion example_configs/google_auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
authentication:
providers:
- provider: google
authenticator: tiled.authenticators:OIDCAuthenticator
authenticator: bluesky_authentication.authenticators:OIDCAuthenticator
args:
audience: tiled # something unique to ensure received headers are for you
# These values come from https://console.cloud.google.com/apis/credential
Expand Down
2 changes: 1 addition & 1 deletion example_configs/keycloak_oidc/config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
authentication:
providers:
- provider: keycloak_oidc
authenticator: tiled.authenticators:ProxiedOIDCAuthenticator
authenticator: bluesky_authentication.authenticators:ProxiedOIDCAuthenticator
args:
audience: tiled_aud
client_id: tiled
Expand Down
6 changes: 3 additions & 3 deletions example_configs/multiple_providers.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
authentication:
providers:
- provider: one
authenticator: tiled.authenticators:DictionaryAuthenticator
authenticator: bluesky_authentication.authenticators:DictionaryAuthenticator
args:
users_to_passwords:
alice: ${ALICE_PASSWORD}
bob: ${BOB_PASSWORD}
cara: ${CARA_PASSWORD}
- provider: two
authenticator: tiled.authenticators:DictionaryAuthenticator
authenticator: bluesky_authentication.authenticators:DictionaryAuthenticator
args:
users_to_passwords:
alice: ${ALICE_PASSWORD}
bob: ${BOB_PASSWORD}
cara: ${CARA_PASSWORD}
- provider: three
authenticator: tiled.authenticators:DictionaryAuthenticator
authenticator: bluesky_authentication.authenticators:DictionaryAuthenticator
args:
users_to_passwords:
alice: ${ALICE_PASSWORD}
Expand Down
2 changes: 1 addition & 1 deletion example_configs/orcid_auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
authentication:
providers:
- provider: orcid
authenticator: tiled.authenticators:OIDCAuthenticator
authenticator: bluesky_authentication.authenticators:OIDCAuthenticator
args:
audience: tiled # something unique to ensure received headers are for you
# These values come from https://orcid.org/developer-tools
Expand Down
2 changes: 1 addition & 1 deletion example_configs/saml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
authentication:
providers:
- provider: saml
authenticator: tiled.authenticators:SAMLAuthenticator
authenticator: bluesky_authentication.authenticators:SAMLAuthenticator
args:
attribute_name: "email"
saml_settings:
Expand Down
2 changes: 1 addition & 1 deletion example_configs/simple_oidc/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
authentication:
providers:
- provider: simple_oidc
authenticator: tiled.authenticators:OIDCAuthenticator
authenticator: bluesky_authentication.authenticators:OIDCAuthenticator
args:
audience: ${OIDC_CLIENT_ID}
client_id: ${OIDC_CLIENT_ID}
Expand Down
2 changes: 1 addition & 1 deletion example_configs/toy_authentication.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
authentication:
providers:
- provider: toy
authenticator: tiled.authenticators:DictionaryAuthenticator
authenticator: bluesky_authentication.authenticators:DictionaryAuthenticator
args:
users_to_passwords:
alice: ${ALICE_PASSWORD}
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ requires-python = ">=3.10"
# data structures you care about.
# Use pip install tiled[all] to get everything.
dependencies = [
"bluesky-authentication",
"httpx >=0.20.0,!=0.23.1",
"json-merge-patch",
"jsonpatch",
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ def minio_uri():
"providers": [
{
"provider": "toy",
"authenticator": "tiled.authenticators:DictionaryAuthenticator",
"authenticator": "bluesky_authentication.authenticators:DictionaryAuthenticator",
"args": {
"users_to_passwords": {"alice": "secret1", "bob": "secret2"},
},
Expand Down
2 changes: 1 addition & 1 deletion tests/test_access_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"providers": [
{
"provider": "toy",
"authenticator": "tiled.authenticators:DictionaryAuthenticator",
"authenticator": "bluesky_authentication.authenticators:DictionaryAuthenticator",
"args": {
"users_to_passwords": {
"alice": "alice",
Expand Down
8 changes: 4 additions & 4 deletions tests/test_authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,12 +260,12 @@ def test_multiple_providers(enter_username_password, config, monkeypatch):
[
{
"provider": "second",
"authenticator": "tiled.authenticators:DictionaryAuthenticator",
"authenticator": "bluesky_authentication.authenticators:DictionaryAuthenticator",
"args": {"users_to_passwords": {"cara": "secret3", "doug": "secret4"}},
},
{
"provider": "third",
"authenticator": "tiled.authenticators:DictionaryAuthenticator",
"authenticator": "bluesky_authentication.authenticators:DictionaryAuthenticator",
"args": {
# Duplicate 'cara' username.
"users_to_passwords": {"cara": "secret5", "emilia": "secret6"}
Expand All @@ -292,12 +292,12 @@ def test_multiple_providers_name_collision(config):
config["authentication"]["providers"] = [
{
"provider": "some_name",
"authenticator": "tiled.authenticators:DictionaryAuthenticator",
"authenticator": "bluesky_authentication.authenticators:DictionaryAuthenticator",
"args": {"users_to_passwords": {"cara": "secret3", "doug": "secret4"}},
},
{
"provider": "some_name", # duplicate!
"authenticator": "tiled.authenticators:DictionaryAuthenticator",
"authenticator": "bluesky_authentication.authenticators:DictionaryAuthenticator",
"args": {
# Duplicate 'cara' username.
"users_to_passwords": {"cara": "secret5", "emilia": "secret6"}
Expand Down
Loading
Loading