phlo-oauth2-proxy 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- phlo_oauth2_proxy/__init__.py +1 -0
- phlo_oauth2_proxy/plugin.py +51 -0
- phlo_oauth2_proxy/service.yaml +63 -0
- phlo_oauth2_proxy-0.2.0.dist-info/METADATA +15 -0
- phlo_oauth2_proxy-0.2.0.dist-info/RECORD +8 -0
- phlo_oauth2_proxy-0.2.0.dist-info/WHEEL +5 -0
- phlo_oauth2_proxy-0.2.0.dist-info/entry_points.txt +2 -0
- phlo_oauth2_proxy-0.2.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""oauth2-proxy authentication gateway for Phlo."""
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"""oauth2-proxy service plugin implementation."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from phlo.plugins import PackageYamlServicePlugin, PluginMetadata
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Oauth2ProxyServicePlugin(PackageYamlServicePlugin):
|
|
9
|
+
"""Service plugin for oauth2-proxy authentication gateway.
|
|
10
|
+
|
|
11
|
+
This plugin provides integration with oauth2-proxy, an OAuth2/OIDC
|
|
12
|
+
authentication proxy that implements forward-auth with Traefik.
|
|
13
|
+
It reads service configuration from a bundled service.yaml file
|
|
14
|
+
and exposes standard Phlo plugin metadata.
|
|
15
|
+
|
|
16
|
+
Attributes:
|
|
17
|
+
None
|
|
18
|
+
|
|
19
|
+
Example:
|
|
20
|
+
>>> plugin = Oauth2ProxyServicePlugin()
|
|
21
|
+
>>> metadata = plugin.metadata
|
|
22
|
+
>>> print(metadata.name, metadata.version)
|
|
23
|
+
oauth2-proxy 0.1.0
|
|
24
|
+
>>> definition = plugin.service_definition
|
|
25
|
+
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
@property
|
|
29
|
+
def metadata(self) -> PluginMetadata:
|
|
30
|
+
"""Return plugin metadata for the oauth2-proxy service.
|
|
31
|
+
|
|
32
|
+
Returns:
|
|
33
|
+
PluginMetadata: Plugin metadata containing name, version,
|
|
34
|
+
description, author, and tags.
|
|
35
|
+
|
|
36
|
+
Example:
|
|
37
|
+
>>> plugin = Oauth2ProxyServicePlugin()
|
|
38
|
+
>>> meta = plugin.metadata
|
|
39
|
+
>>> meta.name
|
|
40
|
+
'oauth2-proxy'
|
|
41
|
+
>>> meta.tags
|
|
42
|
+
['auth', 'proxy', 'oidc']
|
|
43
|
+
|
|
44
|
+
"""
|
|
45
|
+
return PluginMetadata(
|
|
46
|
+
name="oauth2-proxy",
|
|
47
|
+
version="0.1.0",
|
|
48
|
+
description="OAuth2/OIDC authentication proxy for Phlo services",
|
|
49
|
+
author="Phlo Team",
|
|
50
|
+
tags=["auth", "proxy", "oidc"],
|
|
51
|
+
)
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
name: oauth2-proxy
|
|
2
|
+
description: OAuth2/OIDC authentication proxy for forward-auth with Traefik
|
|
3
|
+
category: auth
|
|
4
|
+
default: false
|
|
5
|
+
profile: proxy
|
|
6
|
+
|
|
7
|
+
image: quay.io/oauth2-proxy/oauth2-proxy:v7.7.1
|
|
8
|
+
|
|
9
|
+
compose:
|
|
10
|
+
restart: unless-stopped
|
|
11
|
+
labels:
|
|
12
|
+
phlo.metrics.enabled: "false"
|
|
13
|
+
environment:
|
|
14
|
+
OAUTH2_PROXY_HTTP_ADDRESS: "0.0.0.0:4180"
|
|
15
|
+
OAUTH2_PROXY_REVERSE_PROXY: "true"
|
|
16
|
+
OAUTH2_PROXY_SET_XAUTHREQUEST: "true"
|
|
17
|
+
OAUTH2_PROXY_PASS_ACCESS_TOKEN: "false"
|
|
18
|
+
OAUTH2_PROXY_PROVIDER: "${OAUTH2_PROXY_PROVIDER:-oidc}"
|
|
19
|
+
OAUTH2_PROXY_OIDC_ISSUER_URL: "${OAUTH2_PROXY_OIDC_ISSUER_URL}"
|
|
20
|
+
OAUTH2_PROXY_CLIENT_ID: "${OAUTH2_PROXY_CLIENT_ID}"
|
|
21
|
+
OAUTH2_PROXY_CLIENT_SECRET: "${OAUTH2_PROXY_CLIENT_SECRET}"
|
|
22
|
+
OAUTH2_PROXY_COOKIE_SECRET: "${OAUTH2_PROXY_COOKIE_SECRET}"
|
|
23
|
+
OAUTH2_PROXY_COOKIE_SECURE: "${OAUTH2_PROXY_COOKIE_SECURE:-false}"
|
|
24
|
+
OAUTH2_PROXY_REDIRECT_URL: "${OAUTH2_PROXY_REDIRECT_URL:-http://api.phlo.localhost/oauth2/callback}"
|
|
25
|
+
OAUTH2_PROXY_EMAIL_DOMAINS: "${OAUTH2_PROXY_EMAIL_DOMAINS:-*}"
|
|
26
|
+
OAUTH2_PROXY_UPSTREAMS: "static://202"
|
|
27
|
+
OAUTH2_PROXY_SKIP_PROVIDER_BUTTON: "true"
|
|
28
|
+
healthcheck:
|
|
29
|
+
test:
|
|
30
|
+
[
|
|
31
|
+
"CMD",
|
|
32
|
+
"wget",
|
|
33
|
+
"--quiet",
|
|
34
|
+
"--tries=1",
|
|
35
|
+
"--spider",
|
|
36
|
+
"http://127.0.0.1:4180/ping",
|
|
37
|
+
]
|
|
38
|
+
interval: 30s
|
|
39
|
+
timeout: 5s
|
|
40
|
+
retries: 3
|
|
41
|
+
start_period: 10s
|
|
42
|
+
|
|
43
|
+
env_vars:
|
|
44
|
+
OAUTH2_PROXY_PROVIDER:
|
|
45
|
+
default: oidc
|
|
46
|
+
description: OAuth2 provider type (oidc, google, github, etc.)
|
|
47
|
+
OAUTH2_PROXY_OIDC_ISSUER_URL:
|
|
48
|
+
description: OIDC issuer URL (e.g., https://accounts.google.com)
|
|
49
|
+
OAUTH2_PROXY_CLIENT_ID:
|
|
50
|
+
description: OAuth2 client ID from your identity provider
|
|
51
|
+
OAUTH2_PROXY_CLIENT_SECRET:
|
|
52
|
+
description: OAuth2 client secret (store in .phlo/.env.local)
|
|
53
|
+
OAUTH2_PROXY_COOKIE_SECRET:
|
|
54
|
+
description: Random 32-byte base64 string for cookie encryption (generate with python -c "import secrets; print(secrets.token_urlsafe(32))")
|
|
55
|
+
OAUTH2_PROXY_COOKIE_SECURE:
|
|
56
|
+
default: "false"
|
|
57
|
+
description: Set to true when using HTTPS
|
|
58
|
+
OAUTH2_PROXY_REDIRECT_URL:
|
|
59
|
+
default: http://api.phlo.localhost/oauth2/callback
|
|
60
|
+
description: OAuth2 callback URL (must match IdP config)
|
|
61
|
+
OAUTH2_PROXY_EMAIL_DOMAINS:
|
|
62
|
+
default: "*"
|
|
63
|
+
description: Comma-separated list of allowed email domains (use * for any)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: phlo-oauth2-proxy
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: oauth2-proxy service plugin for Phlo
|
|
5
|
+
Author-email: Phlo Team <team@phlo.dev>
|
|
6
|
+
License: MIT
|
|
7
|
+
Requires-Python: >=3.11
|
|
8
|
+
Description-Content-Type: text/plain
|
|
9
|
+
Requires-Dist: phlo>=0.1.0
|
|
10
|
+
Requires-Dist: pyyaml>=6.0.1
|
|
11
|
+
Provides-Extra: dev
|
|
12
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
13
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
14
|
+
|
|
15
|
+
oauth2-proxy authentication gateway service plugin for Phlo.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
phlo_oauth2_proxy/__init__.py,sha256=qIIYaXnxYNC60MKgrFetUeTgszIGF2jvvk3Ddq57bL8,52
|
|
2
|
+
phlo_oauth2_proxy/plugin.py,sha256=XDYhEX-uwa0-jdiygPQPyF4fAOVIyOupKhZlsXgYuLM,1552
|
|
3
|
+
phlo_oauth2_proxy/service.yaml,sha256=338x0hRW1ADc05uxV588SwW08RV3DT4eEmlngW-a2Yk,2289
|
|
4
|
+
phlo_oauth2_proxy-0.2.0.dist-info/METADATA,sha256=GNn7AG0__QekAUX8MgLhWyAb9ztUpy3K2AWR9o9BWtE,445
|
|
5
|
+
phlo_oauth2_proxy-0.2.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
6
|
+
phlo_oauth2_proxy-0.2.0.dist-info/entry_points.txt,sha256=-Ze_JeSx0eAvfvU4Zf4z23L3kmCLYWYrZ2Yc0-AAdoU,89
|
|
7
|
+
phlo_oauth2_proxy-0.2.0.dist-info/top_level.txt,sha256=xoAe-BhjiOlPps5JXe7qcMP4cVVPk_r5S-ga8SoYSDI,18
|
|
8
|
+
phlo_oauth2_proxy-0.2.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
phlo_oauth2_proxy
|