Skip to content

Commit

Permalink
build: Add default (generic OIDC) snap package for the broker (#21)
Browse files Browse the repository at this point in the history
Add snap packaging for the default version of the broker.

UDENG-2044
  • Loading branch information
denisonbarbosa authored Jun 7, 2024
2 parents 7382538 + 71e19b9 commit 24f62ee
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 4 deletions.
8 changes: 4 additions & 4 deletions config/oidc-broker.broker → config/oidc-broker
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[authd]
name = OIDC Broker
brand_icon = broker_icon.png
dbus_name = com.ubuntu.authd.oidc_broker
dbus_object = /com/ubuntu/authd/oidc_broker
brand_icon = {abs_path_to_icon}
dbus_name = com.ubuntu.authd.OidcBroker
dbus_object = /com/ubuntu/authd/OidcBroker

[oidc]
issuer = https://{issuer_url}
client_id = client_id
client_id = {client_id}

# The amount of days the user will be allowed to authenticate without a network connection.
offline_expiration = 180
Expand Down
24 changes: 24 additions & 0 deletions snap/hooks/install
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh
set -eu

snap_base_dir=$(dirname ${SNAP})

cat <<EOF > ${SNAP_COMMON}/oidc-broker
[authd]
name = OIDC Broker
brand_icon = ${snap_base_dir}/current/broker_icon.png
dbus_name = com.ubuntu.authd.OidcBroker
dbus_object = /com/ubuntu/authd/OidcBroker
[oidc]
issuer = https://{issuer_url}
client_id = {client_id}
# The amount of days the user will be allowed to authenticate without a network connection.
# offline_expiration = 180
# The directory where the user's home directory will be created.
# The user home directory will be created in the format of {home_base_dir}/{username}
# home_base_dir = /home
EOF
40 changes: 40 additions & 0 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: oidc-broker
summary: OIDC Broker for authd
description: |
Broker that enables OIDC authentication for authd.
version: git
grade: stable
base: core24
confinement: strict
license: GPL-3.0+

apps:
oidc-broker:
command: bin/oidc-broker
daemon: simple
slots:
- dbus-oidc
plugs:
- network
- config-files
restart-condition: always

slots:
dbus-oidc:
interface: dbus
bus: system
name: com.ubuntu.authd.OidcBroker

plugs:
config-files:
interface: system-files
read:
- /etc/authd/brokers.d/oidc-broker

parts:
oidc-broker:
source: .
source-type: local
plugin: go
build-snaps:
- go

0 comments on commit 24f62ee

Please sign in to comment.