GithubHelp home page GithubHelp logo

elysia-auth-drizzle's Introduction

elysia-auth-drizzle

Library who handle authentification (Header/Cookie/QueryParam).

Usage

import { elysiaAuthDrizzlePlugin } from 'elysia-auth-drizzle';

export const app = new Elysia()
  .use(
      elysiaAuthDrizzlePlugin<typeof users.$inferSelect>({
        config: [
          {
            url: '/public',
            method: 'GET',
          },
        ],
        jwtSecret: 'test',
        drizzle: {
          db: db,
          usersSchema: users,
          tokensSchema: tokens,
        },
      }),
    )

Plugin options

name default description
jwtSecret undefined Secret used to sign JWT
drizzle undefined Contain drizzle db + users schema + tokens schemas ({db, userSchemas, tokenSchemas} / Token Schemas is optional if you use verifyAccessTokenOnlyInJWT)
config [] Array who contain url with method allowed in public
cookieSecret undefined (optional) Secret used to sign cookie value
verifyAccessTokenOnlyInJWT false (optional) Check only JWT expiration not token validity in DB
userValidation undefined (optional) (user) => void or Promise<void> / Allow to make more check regarding user (ex: check if user is banned)

Tests

To execute jest tests (all errors, type integrity test)

bun test

elysia-auth-drizzle's People

Contributors

qlaffont avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

soyricardodev

elysia-auth-drizzle's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

bun
package.json
  • @bogeychan/elysia-logger ^0.0.22
  • jsonwebtoken ^9.0.2
  • unify-errors ^1.2.227
  • @elysiajs/eden ^1.0.6
  • @types/jsonwebtoken ^9.0.6
  • @typescript-eslint/eslint-plugin 7.14.1
  • @typescript-eslint/parser 7.14.1
  • drizzle-kit ^0.22.0
  • drizzle-orm ^0.31.0
  • eslint 8.57.0
  • eslint-config-prettier 9.1.0
  • eslint-plugin-import 2.29.1
  • eslint-plugin-prettier 5.1.3
  • eslint-plugin-simple-import-sort 12.1.0
  • pg ^8.11.3
  • postgres ^3.4.4
  • prettier 3.3.2
  • tsup ^8.0.2
  • unify-elysia ^1.0.5
  • elysia ^1.0.9
  • pnpm 9.4.0
docker-compose
docker-compose.yml
github-actions
.github/workflows/main.yml
  • actions/checkout v4
  • oven-sh/setup-bun v2
.github/workflows/publish.yml
  • dorny/paths-filter v3
  • actions/checkout v4
  • oven-sh/setup-bun v2
  • qzb/standard-version-action v1.0.13
  • JS-DevTools/npm-publish v3

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.