check going through oathkeeper

This commit is contained in:
Karol Wypchlo 2021-02-05 17:46:11 +01:00
parent 79eabb765b
commit 18c056ae52
10 changed files with 2 additions and 187 deletions

View File

@ -101,33 +101,6 @@ services:
depends_on:
- kratos-migrate
# kratos-selfservice-ui-node:
# image: oryd/kratos-selfservice-ui-node:v0.5.0-alpha.1
# container_name: kratos-selfservice-ui-node
# restart: on-failure
# logging: *default-logging
# volumes:
# - ./docker/kratos-selfservice-ui-node/main.hbs:/usr/src/app/views/layouts/main.hbs:ro
# - ./docker/kratos-selfservice-ui-node/login.hbs:/usr/src/app/views/login.hbs:ro
# - ./docker/kratos-selfservice-ui-node/dashboard.hbs:/usr/src/app/views/dashboard.hbs:ro
# - ./docker/kratos-selfservice-ui-node/registration.hbs:/usr/src/app/views/registration.hbs:ro
# - ./docker/kratos-selfservice-ui-node/icon_logo.hbs:/usr/src/app/views/partials/icon_logo.hbs:ro
# - ./docker/kratos-selfservice-ui-node/branding.css:/usr/src/app/public/branding.css:ro
# - ./docker/kratos-selfservice-ui-node/favico.png:/usr/src/app/public/favico.png:ro
# environment:
# - PORT=4435
# - SECURITY_MODE=jwks
# - PROJECT_NAME=Skynet
# - BASE_URL=/
# - KRATOS_BROWSER_URL=/.ory/kratos/public
# - JWKS_URL=http://oathkeeper:4456/.well-known/jwks.json
# - KRATOS_PUBLIC_URL=http://kratos:4433/
# - KRATOS_ADMIN_URL=http://kratos:4434/
# - SQA_OPT_OUT=true
# networks:
# shared:
# ipv4_address: 10.10.10.82
dashboard:
build:
context: ./packages/dashboard

View File

@ -1,18 +0,0 @@
:root {
--base-white: #ffffff;
--base-light: #f0f0f1;
--base-text: #99999e;
--base-main: #5a5b6a;
--base-dark: #19191d;
--base-black: #000000;
--primary-light: #ecfdfe;
--primary-half: #4ea156;
--primary-main: #57b560;
--primary-dark: #2e0473;
--red-strong: #f44336;
--green-strong: #43a047;
}
.logo {
margin: 0 auto;
}

View File

@ -1,15 +0,0 @@
<div class="content">
{{> header}}
<div class="container">
<h2 class="greeting">Welcome back, <span class="user-identifier">{{session.identity.traits.email}}</span>!</h2>
<h3>This will be your dashboard!</h3>
<p>Right now there is nothing else here but in future, you will be able to list your pinned files, upgrade to a
premium tiers and see your usage stats.</p>
<hr class="divider">
<p>
<a href="https://siasky.net">Go back to siasky.net</a>
</p>
</div>
</div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg class="logo" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="64pt"
height="64pt" viewBox="0 0 64 64" version="1.1">
<g id="surface1">
<path style=" stroke:none;fill-rule:evenodd;fill:rgb(34.509804%,70.980392%,37.647059%);fill-opacity:1;"
d="M 46.761719 49.546875 C 35.414062 54.125 22.710938 47.1875 20.429688 35.167969 L 12.800781 29.898438 C 11.609375 50.492188 33.152344 64.65625 51.585938 55.394531 C 53.746094 54.308594 55.75 52.933594 57.542969 51.3125 L 57.570312 51.3125 C 58.804688 50.160156 58.535156 48.136719 57.039062 47.351562 L 0 17.226562 Z M 46.761719 49.546875 " />
<path style=" stroke:none;fill-rule:evenodd;fill:rgb(34.509804%,70.980392%,37.647059%);fill-opacity:1;"
d="M 62.753906 43.613281 L 62.753906 43.5625 C 63.078125 42.414062 62.480469 41.207031 61.371094 40.773438 L 23.058594 25.628906 L 59.402344 45.011719 C 60.710938 45.730469 62.347656 45.046875 62.753906 43.613281 Z M 62.753906 43.613281 " />
<path style=" stroke:none;fill-rule:evenodd;fill:rgb(34.509804%,70.980392%,37.647059%);fill-opacity:1;"
d="M 63.941406 35.21875 C 64.261719 27.835938 63.328125 20.683594 58.796875 14.828125 C 53.417969 7.894531 44.390625 5.175781 37.167969 5.796875 C 36.605469 5.84375 36.042969 5.929688 35.480469 5.976562 C 27.890625 6.679688 20.695312 11.058594 16.398438 18.503906 C 16.03125 19.140625 15.695312 19.796875 15.386719 20.441406 C 15.191406 20.703125 14.996094 20.960938 14.8125 21.230469 L 21.296875 24.683594 C 21.597656 23.878906 21.953125 23.089844 22.359375 22.332031 C 29.410156 9.117188 48.121094 8.496094 56.035156 21.210938 C 58.296875 24.84375 59.300781 29.121094 58.882812 33.378906 L 34.710938 26.894531 L 60.75 37.1875 C 62.210938 37.765625 63.816406 36.765625 63.941406 35.199219 Z M 63.941406 35.21875 " />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -1,28 +0,0 @@
<div class="auth">
<div class="container">
{{> icon_logo}}
<h5 class="subheading">Welcome to siasky.net!</h5>
{{> messages messages=messages className="global"}}
{{#if password}}
<div id="login-password">
{{> form submitLabel="Sign in" form=password}}
</div>
{{/if}}
{{#if oidc}}
<div id="login-oidc">
{{> form form=oidc}}
</div>
{{/if}}
<hr class="divider">
<div class="alternative-actions">
<!-- <a href="auth/registration">Recover password</a> -->
<a href="{{pathPrefix}}auth/registration">Register new account</a>
<a href="{{pathPrefix}}recovery">Reset password</a>
</div>
</div>
</div>

View File

@ -1,23 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
{{#if baseUrl}}
<base href="{{baseUrl}}" />
{{/if}}
<link rel="icon" type="image/png" href="{{pathPrefix}}favico.png">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css">
<meta charset="utf-8">
<title>{{projectName}}</title>
<link rel="stylesheet" href="{{pathPrefix}}index.css">
<link rel="stylesheet" href="{{pathPrefix}}typography.css">
<link rel="stylesheet" href="{{pathPrefix}}form.css">
<link rel="stylesheet" href="{{pathPrefix}}auth.css">
<link rel="stylesheet" href="{{pathPrefix}}branding.css">
</head>
<body>
{{{body}}}
</body>
</html>

View File

@ -1,27 +0,0 @@
<div class="auth">
<div class="container">
{{> icon_logo}}
<h5 class="subheading">Welcome to siasky.net! <br />
Use the form below to sign up:</h5>
{{> messages messages=messages className="global"}}
{{#if password}}
<div id="registration-password">
{{> form submitLabel="Sign up" form=password}}
</div>
{{/if}}
{{#if oidc}}
<div id="registration-oidc">
{{> form form=oidc}}
</div>
{{/if}}
<hr class="divider">
<div class="alternative-actions">
<a href="{{pathPrefix}}auth/login">Already have an account? Log in instead</a>
</div>
</div>
</div>

View File

@ -18,40 +18,6 @@
mutators:
- handler: noop
# - id: "ory:kratos-selfservice-ui-node:anonymous"
# upstream:
# preserve_host: true
# url: "http://kratos-selfservice-ui-node:4435"
# match:
# url: "http://oathkeeper:4455/<{error,recovery,verify,auth/*,**.css,**.js}{/,}>"
# methods:
# - GET
# authenticators:
# - handler: anonymous
# authorizer:
# handler: allow
# mutators:
# - handler: noop
# - id: "ory:kratos-selfservice-ui-node:protected"
# upstream:
# preserve_host: true
# url: "http://kratos-selfservice-ui-node:4435"
# match:
# url: "http://oathkeeper:4455/<{,debug,dashboard,settings}>"
# methods:
# - GET
# authenticators:
# - handler: cookie_session
# authorizer:
# handler: allow
# mutators:
# - handler: id_token
# errors:
# - handler: redirect
# config:
# to: http://127.0.0.1/auth/login
- id: "dashboard:anonymous"
upstream:
preserve_host: true
@ -91,10 +57,9 @@
preserve_host: true
url: "http://accounts:3000"
match:
url: "http://oathkeeper<{,:4455}>/<{user,user/**,track/**}>"
url: "http://oathkeeper<{,:4455}>/<{user,user/**}>"
methods:
- GET
- POST
authenticators:
- handler: cookie_session
authorizer:

View File

@ -348,7 +348,7 @@ server {
if skylink and ngx.status >= ngx.HTTP_OK and ngx.status < ngx.HTTP_SPECIAL_RESPONSE then
local http = require("socket.http")
local headers = { Cookie = ngx.req.get_headers()["Cookie"] }
local ok, statusCode, headers, statusText = http.request { url = "http://oathkeeper:4455/track/download/" .. skylink, method = "POST", headers = headers }
local ok, statusCode, headers, statusText = http.request { url = "http://accounts:3000/track/download/" .. skylink, method = "POST", headers = headers }
if statusCode ~= ngx.HTTP_NO_CONTENT then
ngx.log(ngx.ERR, "accounts endpoint /track/download/" .. skylink .. " failed with error " .. statusCode)
end