Skip to content

Commit

Permalink
feat: hook up login-ui from device-flow branch
Browse files Browse the repository at this point in the history
  • Loading branch information
shipperizer committed Dec 6, 2023
1 parent 57363cb commit 7c336f4
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 4 deletions.
4 changes: 2 additions & 2 deletions hack/helm/hydra.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ hydra:
public: https://iam.internal/
login: https://iam.internal/ui/login
consent: https://iam.internal/ui/consent
device: http://iam.internal/admin/oauth2/auth/requests/device/verify
# device: http://iam.internal:9000/api/device # this relies on the fact i have localhost as iam.internal and a script with server on port 9000
# device: http://iam.internal/admin/oauth2/auth/requests/device/verify
device: https://iam.internal/ui/device
post_device_done: https://iam.internal/api/v0/status
error: https://iam.internal//ui/oidc_error
ttl:
Expand Down
9 changes: 8 additions & 1 deletion hack/kubectl/iam.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
spec:
containers:
- name: iam
image: ghcr.io/canonical/identity-platform-login-ui:v0.11.3
image: identity-platform-login-ui
envFrom:
- configMapRef:
name: iam
Expand Down Expand Up @@ -78,6 +78,13 @@ spec:
name: iam
port:
number: 8000
- pathType: Prefix
path: "/api/device"
backend:
service:
name: iam
port:
number: 8000
- pathType: Prefix
path: "/api/kratos"
backend:
Expand Down
12 changes: 12 additions & 0 deletions hack/login-ui/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

set -x
# script requires the availability of rockcraft, skopeo, yq and docker in the host system
# it also requires sudo permissions to run skopeo

# export version=$(yq -r '.version' rockcraft.yaml)
rockcraft pack -v

sudo skopeo --insecure-policy copy "oci-archive:identity-platform-login-ui_$(yq -r '.version' rockcraft.yaml)_amd64.rock" docker-daemon:$IMAGE

docker push $IMAGE
Binary file not shown.
44 changes: 44 additions & 0 deletions hack/login-ui/rockcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: identity-platform-login-ui

base: bare
build-base: [email protected]
version: '0.11.3' # x-release-please-version
summary: Canonical Identity platform login UI
description: |
This is the Canonical Identity platform login UI used for connecting
Ory Kratos with Ory Hydra.
license: Apache-2.0

platforms:
amd64:

services:
login-ui:
override: replace
command: /usr/bin/identity-platform-login-ui
startup: enabled

parts:
certificates:
plugin: nil
stage-packages:
- ca-certificates

go-build:
plugin: go
source: https://github.com/canonical/identity-platform-login-ui
source-type: git
source-branch: device-flow-poc
build-snaps:
- go/1.19/stable
- node/18/stable
build-packages:
- make
- git
override-build: |
make npm-build build
install -D -m755 cmd/app ${CRAFT_PART_INSTALL}/opt/identity-platform-login-ui/bin/app
organize:
opt/identity-platform-login-ui/bin/app: usr/bin/identity-platform-login-ui
stage-packages:
- base-files_var
11 changes: 10 additions & 1 deletion skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,19 @@ apiVersion: skaffold/v4beta6
kind: Config
build:
artifacts:
- image: "identity-platform-login-ui"
context: hack/login-ui
custom:
buildCommand: ./build.sh
dependencies:
paths:
- rockcraft.yaml
platforms: ["linux/amd64"]
- image: "flow-test"
context: hack/flow-test
docker:
dockerfile: hack/flow-test/Dockerfile
dockerfile: Dockerfile
platforms: ["linux/amd64"]
- image: "hydra"
custom:
buildCommand: ./build.sh
Expand Down

0 comments on commit 7c336f4

Please sign in to comment.