Commit 1a6e77d5 authored by Grant's avatar Grant
Browse files

Merge branch '10-handoff' into 'main'

Third-party authentication handoff sessions

See merge request !3
parents 56cf0bcf dea66983
Loading
Loading
Loading
Loading
Loading

.gitlab-ci.yml

0 → 100644
+18 −0
Original line number Diff line number Diff line
build wiki:
  stage: build
  trigger:
    include: .gitlab/ci/wiki.yml
  allow_failure: true
  rules:
    - if: $CI_PIPELINE_SOURCE != "merge_request_event" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

build image:
  stage: build
  image: docker:latest
  rules:
    - if: $CI_PIPELINE_SOURCE != "merge_request_event" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
  before_script:
    - echo $CI_REGISTRY_PASSWORD | docker login $CI_REGISTRY -u $CI_REGISTRY_USER --password-stdin
  script:
    - docker build --tag $CI_REGISTRY_IMAGE .
    - docker push $CI_REGISTRY_IMAGE

.gitlab/ci/wiki.yml

0 → 100644
+14 −0
Original line number Diff line number Diff line
build-wiki:
  image: alpine
  stage: build
  before_script:
    - apk add --no-cache git git-subtree
  script:
    - git config user.email "ci@sc07.company"
    - git config user.name "ci"
    - git remote remove gitlab-wiki || true
    - git remote add gitlab-wiki "https://ci:$CI_TOKEN@sc07.dev/sc07/fediverse-auth.wiki.git"
    - git status
    - git checkout main
    - git pull
    - git push gitlab-wiki `git subtree split -P doc main`:main --force
+2 −1
Original line number Diff line number Diff line
@@ -21,7 +21,8 @@
    "express-session": "^1.18.0",
    "ioredis": "^5.6.1",
    "oidc-provider": "^8.8.1",
    "openid-client": "^5.6.5"
    "openid-client": "^5.6.5",
    "string-strip-html": "^13.4.12"
  },
  "devDependencies": {
    "@types/cookie-parser": "^1.4.7",
+10 −0
Original line number Diff line number Diff line
-- CreateTable
CREATE TABLE "HandoffSession" (
    "id" TEXT NOT NULL,
    "userId" TEXT NOT NULL,
    "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "expiresAt" TIMESTAMP(3) NOT NULL,

    CONSTRAINT "HandoffSession_pkey" PRIMARY KEY ("id")
);
+9 −0
Original line number Diff line number Diff line
@@ -51,3 +51,12 @@ model FediverseUser {
  createdAt DateTime @default(now())
  updatedAt DateTime @default(now()) @updatedAt
}

model HandoffSession {
  id     String @id @default(uuid())
  userId String // eg. https://grants.cafe/users/grant

  createdAt DateTime @default(now())
  updatedAt DateTime @default(now()) @updatedAt
  expiresAt DateTime
}
Loading