Skip to content

Commit 23c1fa8

Browse files
test oidc setup plural
1 parent 63af97c commit 23c1fa8

File tree

3 files changed

+32
-3
lines changed

3 files changed

+32
-3
lines changed

.github/workflows/test-pr.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: CI / Demo PR
2+
3+
env:
4+
DOCKER_METADATA_PR_HEAD_SHA: 'true'
5+
6+
on:
7+
push:
8+
branches:
9+
- master
10+
- genstage-stack-gs-reconciler
11+
jobs:
12+
pr:
13+
permissions:
14+
id-token: write
15+
contents: read
16+
name: Generate PR
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout the repo
20+
uses: actions/checkout@v3
21+
with:
22+
fetch-depth: 0
23+
- name: setup plural
24+
uses: pluralsh/setup-plural@4c3737b0836ff7d5bd63faa205189b24d1991a4c
25+
with:
26+
27+
consoleUrl: https://console.plrldemo.onplural.sh

lib/console/deployments/settings.ex

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,11 +344,13 @@ defmodule Console.Deployments.Settings do
344344
scopes = Enum.flat_map(credentials, & &1.scopes || [])
345345
|> Enum.uniq()
346346
sign_token(user, scopes)
347-
_ -> {:error, "no federated credential for #{email} match jwt claims"}
347+
_ -> {:error, "no federated credentials for #{email} match jwt claims"}
348348
end
349349
else
350350
{:token, _} -> {:error, "invalid jwt format"}
351-
{:config, _} -> {:error, "invalid issuer url from jwt"}
351+
{:config, _} = res ->
352+
Logger.error("failed to fetch issuer configuration: #{inspect(res)}")
353+
{:error, "invalid issuer url from jwt"}
352354
{:validate, _} -> {:error, "could not validate jwt"}
353355
end
354356
end

lib/console_web/router.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ defmodule ConsoleWeb.Router do
1616
scope "/v1", ConsoleWeb do
1717
pipe_through [:api]
1818

19+
post "/token/exchange", JWTController, :exchange
1920
get "/dashboard/cluster", WebhookController, :cluster
2021
end
2122

@@ -79,7 +80,6 @@ defmodule ConsoleWeb.Router do
7980
pipe_through [:auth]
8081

8182
scope "/v1", ConsoleWeb do
82-
post "/token/exchange", JWTController, :exchange
8383
get "/digests", GitController, :digest
8484
get "/compliance/report", ComplianceController, :report
8585
get "/compliance/report/:name", ComplianceController, :report

0 commit comments

Comments
 (0)