Allowing OIDC Login to airflow.
Project description
This repo contains a provider package for apache airflow.
It provides an auth_manager that is able to connect to any OIDC compliant Identity Provider, and manages user permissions based on their group memberships, which are mapped to team-roles.
The exact mapping is still work in progress, but it should conform to the roles defined as the current airflow default roles: ANONYMOUS, VIEWER, USER, OPERATOR and ADMIN.
An example config via variables in a yaml file can look like this:
AIRFLOW__OAUTH2_AUTH_MANAGER__CLIENT_ID: airflow
AIRFLOW__OAUTH2_AUTH_MANAGER__CLIENT_SECRET: 'secret configured in the IdP'
AIRFLOW__OAUTH2_AUTH_MANAGER__SERVER_URL: https://someserver:1234/realms/airflow/.well-known/openid-configuration
AIRFLOW__OAUTH2_AUTH_MANAGER__SCOPES: "profile email openid roles"
AIRFLOW__OAUTH2_AUTH_MANAGER__TOKEN_PARSER_CLASS: airflow_oidc_provider.auth_manager.token_parser.SimpleOIDCTokenParser
AIRFLOW__OAUTH2_AUTH_MANAGER__TOKEN_PARSER_CONFIG: |
{
"token_key" : "token_key",
"admin_group" : "admin",
"teams" : {
"Team 1" : {
"team1:operator" : "operator",
"team1:user" : "user"
},
"Team 2" : {
"team2:operator" : "operator",
"team2:viewer" : "viewer",
"team2:user" : "user"
}
}
}
Configuration Options
Option name |
default |
description |
|---|---|---|
AIRFLOW__OAUTH2_AUTH_MANAGER__CLIENT_ID |
mandatory |
The client id to be used with the IdP. |
AIRFLOW__OAUTH2_AUTH_MANAGER__CLIENT_SECRET |
mandatory |
The client secret to be used with the IdP. |
AIRFLOW__OAUTH2_AUTH_MANAGER__SERVER_URL |
mandatory |
The URL for the OIDC endpoint of the IdP. Often ends in ‘.well-known/openid-configuration’. |
AIRFLOW__OAUTH2_AUTH_MANAGER__SCOPES |
profile email openid roles |
The scopes that need to be requested for the token to contain groups information. |
AIRFLOW__OAUTH2_AUTH_MANAGER__TOKEN_PARSER_CLASS |
airflow_oidc_provider.auth_manager.token_parser.SimpleOIDCTokenParser |
The class that parses the OIDC token for userinformation. |
AIRFLOW__OAUTH2_AUTH_MANAGER__TOKEN_PARSER_CONFIG |
mandatory for default class, else depends on class |
A config string for the parser class. More details for the default class below. |
SimpleOIDCTokenParser
The SimpleOIDCTokenParser parses the userinfo returned by the IdP for team memberships and access level of the user. To configure it for your specific IdP, and to support slightly off-standard IdPs, it requires some information to parse a token.
The configuration string should be in json format.
json key |
description |
|---|---|
token_key |
The key within the userinfo token, which contains the list of groups the user is a member of |
admin_group |
The name of the group in the userinfo token, which will be matched to airflow ADMIN permissions. |
teams |
|
Testing
The testcases included in this repository depend on some internal airflow development packages, which are not provided in a public registry, and had to be built from source.
Therefore those testcases are not run if the required packages are not present.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file airflow_oidc_provider-0.1.0.tar.gz.
File metadata
- Download URL: airflow_oidc_provider-0.1.0.tar.gz
- Upload date:
- Size: 16.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf8b36c2c2e586ae60eeff88afae53d9072035846d47c89f351b93dac01a167e
|
|
| MD5 |
a4d1de8dd6b7546ff8373462de41df6b
|
|
| BLAKE2b-256 |
f55bac26cfc4acc08ad1f19f9c397ecbcf5f596daa33e86fee66a3cfc2cc9106
|
Provenance
The following attestation bundles were made for airflow_oidc_provider-0.1.0.tar.gz:
Publisher:
python-publish.yml on cboettcher/airflow-oidc-provider
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
airflow_oidc_provider-0.1.0.tar.gz -
Subject digest:
cf8b36c2c2e586ae60eeff88afae53d9072035846d47c89f351b93dac01a167e - Sigstore transparency entry: 1448928476
- Sigstore integration time:
-
Permalink:
cboettcher/airflow-oidc-provider@158ef47a817153027e07a8ccdc7ed58480e8f168 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/cboettcher
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@158ef47a817153027e07a8ccdc7ed58480e8f168 -
Trigger Event:
release
-
Statement type:
File details
Details for the file airflow_oidc_provider-0.1.0-py3-none-any.whl.
File metadata
- Download URL: airflow_oidc_provider-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3509cfd8fdc23fc348fb6dbc4dd8a83b927e6f156b350f3d78fa452d7239dd97
|
|
| MD5 |
6cb6277044a6e6d059a13c519e6900ed
|
|
| BLAKE2b-256 |
f852c71e31c78c1413a7abbfc900d14b52565d7241c01f237a4cab0d8a7cdfe3
|
Provenance
The following attestation bundles were made for airflow_oidc_provider-0.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on cboettcher/airflow-oidc-provider
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
airflow_oidc_provider-0.1.0-py3-none-any.whl -
Subject digest:
3509cfd8fdc23fc348fb6dbc4dd8a83b927e6f156b350f3d78fa452d7239dd97 - Sigstore transparency entry: 1448928556
- Sigstore integration time:
-
Permalink:
cboettcher/airflow-oidc-provider@158ef47a817153027e07a8ccdc7ed58480e8f168 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/cboettcher
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@158ef47a817153027e07a8ccdc7ed58480e8f168 -
Trigger Event:
release
-
Statement type: