Skip to content

Commit

Permalink
Merge pull request #549 from serlo/deployment
Browse files Browse the repository at this point in the history
Deployment
  • Loading branch information
hugotiburtino authored Oct 13, 2023
2 parents 932d209 + a1ec19c commit b4be1f6
Show file tree
Hide file tree
Showing 34 changed files with 173 additions and 197 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,29 @@
"dependencies": {
"fp-ts": "^2.16.1",
"io-ts": "^2.2.20",
"jose": "^4.15.1",
"marked": "^9.0.3",
"preact": "^10.18.0",
"preact-render-to-string": "^6.2.1",
"jose": "^4.15.2",
"marked": "^9.1.0",
"preact": "^10.18.1",
"preact-render-to-string": "^6.2.2",
"sanitize-html": "^2.11.0",
"toucan-js": "^3.3.0"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20231002.0",
"@iarna/toml": "^2.2.5",
"@jest/globals": "^29.7.0",
"@sentry/types": "^7.72.0",
"@sentry/types": "^7.73.0",
"@testing-library/jest-dom": "^6.1.3",
"@types/iarna__toml": "^2.0.3",
"@types/jest": "^29.5.5",
"@types/marked": "^5.0.2",
"@types/node": "^18.18.1",
"@types/marked": "^6.0.0",
"@types/node": "^18.18.4",
"@types/sanitize-html": "^2.9.1",
"@typescript-eslint/eslint-plugin": "^6.7.4",
"@typescript-eslint/parser": "^6.7.4",
"@typescript-eslint/eslint-plugin": "^6.7.5",
"@typescript-eslint/parser": "^6.7.5",
"cross-env": "^7.0.3",
"depcheck": "^1.4.6",
"eslint": "^8.50.0",
"eslint": "^8.51.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-deprecation": "^2.0.0",
"eslint-plugin-import": "^2.28.1",
Expand All @@ -68,7 +68,7 @@
"ts-jest": "^29.1.1",
"ts-unused-exports": "^10.0.1",
"typescript": "^5.2.2",
"wrangler": "^3.10.1"
"wrangler": "^3.11.0"
},
"packageManager": "[email protected]",
"engines": {
Expand Down
28 changes: 1 addition & 27 deletions src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { Instance, createJsonResponse, Url } from './utils'
export function auth(request: Request, env: CFEnvironment): Response | null {
return (
authFrontendSectorIdentifierUriValidation(request, env) ||
authKratosIdentitySchema(request) ||
authKratosGithubJsonnet(request)
authKratosIdentitySchema(request)
)
}

Expand Down Expand Up @@ -100,28 +99,3 @@ function authKratosIdentitySchema(request: Request): Response | null {

return createJsonResponse(schema)
}

function authKratosGithubJsonnet(request: Request): Response | null {
const url = Url.fromRequest(request)
if (url.subdomain !== '' || url.pathname !== '/auth/kratos-github.jsonnet') {
return null
}

const net = `
local claims = {
email_verified: false
} + std.extVar('claims');
{
identity: {
traits: {
[if "email" in claims && claims.email_verified then "email" else null]: claims.email,
},
},
}
`

return new Response(net, {
headers: { 'Content-Type': 'text/plain' },
})
}
Loading

0 comments on commit b4be1f6

Please sign in to comment.