Files
d383856a4f feat: add auth middleware (#449)
* feat: add api key generator

* feat: add basic middleware

* feat: fix schema

* feat: change api

* feat: add api key method

* feat: add basic middleware

* chore: rename variables

* chore: remove console log

* feat: add auth

* chore: fix logic

* chore: fix import

* feat: add example api

* feat: make optional

* feat: add session cookie auth

* feat: add migration

* feat: fix build error

* chore: remove session route

* feat: add name and email to session

* feat: add audit to services

* style: fix type

* chore: fix auth middleware

* feat: add info to context

* chore: fix schema

* feat: add ip util

* feat: add new create endpoint

* feat: add delete endpoint

* feat: add update endpoint

* chore: remove try catch

* feat: add get one endpoint

* feat: register routes

* chore: fix param

* feat: add patch method

* feat: add get many routes and register

* chore: fix import

* feat: init share route

* chore: fix name

* feat: add delete share endpoint

* feat: add get one

* feat: add get many route

* fix: types and schema

* feat: add create handler

* feat: add update route

* feat: delete existing routes

* refactor: remove services

* chore: add prisma pagination extension

* feat: add pagination

* chore: remove import

* feat: add pagination

* chore: fix type

* chore: fix types

* refactor: remove pagination and service

* chore: add expect error comment

* chore: fix type

* feat: add summary and description

* feat: fix type

* feat: fix types

* feat: add error registry map

* style: naming changes

* chore: fix description and summary

* chore: rename

* feat: use function

* feat: add company id to path

* feat: add company id to schema

* feat: add base-x

* feat: add base 58 encoding

* feat: use new strategy

* feat: fix schema

* feat: add user access token

* feat: add tokens utility

* feat: add access token schema

* feat: refactor lib

* refactor: utils

* refactor: session cookie auth middleware

* feat: add secure hash

* feat: use secure hash

* fix: companyId in cookie

* refactor: func

* feat: add access token  middleware

* feat: remove default middlewares

* feat: add utils for tokens

* chore: upgrade packages

* chore: remove auth middleware function

* feat: add helper middleware

* feat: add new middleware

* feat: use hono helpers

* chore: remove utils

* chore: remove type

* feat: add migration for access token

* feat: access token

* feat: add without membership option

* refactor: utils

* fix: verify util

* refactor: change route

* chore: fix sidenav

* chore: rename wordings

* chore: rename router

* chore: update file name

* core: rename policies

* chore: rename apiKey to accessToken and change accessToken route to developer

* chore: working with middleware

* fix: error messages

* feat: keeping it lean and dry

* chore: remove un-used files

* chore: fix build error

* feat: some minor cleanups

* feat: return bearer token error if its invalid instead of returning session error

---------

Co-authored-by: Puru D <[email protected]>
2024-08-07 01:40:56 -05:00

31 lines
1.1 KiB
SQL

/*
Warnings:
- You are about to drop the column `hashedToken` on the `ApiKey` table. All the data in the column will be lost.
- You are about to drop the column `keyId` on the `ApiKey` table. All the data in the column will be lost.
- A unique constraint covering the columns `[hashedKey]` on the table `ApiKey` will be added. If there are existing duplicate values, this will fail.
- Added the required column `hashedKey` to the `ApiKey` table without a default value. This is not possible if the table is not empty.
- Added the required column `partialKey` to the `ApiKey` table without a default value. This is not possible if the table is not empty.
*/
-- DropIndex
DROP INDEX "ApiKey_hashedToken_key";
-- DropIndex
DROP INDEX "ApiKey_keyId_active_idx";
-- DropIndex
DROP INDEX "ApiKey_keyId_key";
-- DropIndex
DROP INDEX "ApiKey_membershipId_active_idx";
-- AlterTable
ALTER TABLE "ApiKey" DROP COLUMN "hashedToken",
DROP COLUMN "keyId",
ADD COLUMN "hashedKey" TEXT NOT NULL,
ADD COLUMN "partialKey" TEXT NOT NULL;
-- CreateIndex
CREATE UNIQUE INDEX "ApiKey_hashedKey_key" ON "ApiKey"("hashedKey");