3 Commits
1.0.2 ... 1.0.4

Author SHA1 Message Date
d3210b73c9 Fucked up paths 2023-05-23 22:12:01 -04:00
6951cd3218 - Fix package versioning 2023-05-23 22:05:27 -04:00
9393a8441a Added drone pipeline 2023-05-23 15:40:57 -04:00
7 changed files with 104 additions and 13 deletions

91
.drone.yml Normal file
View File

@@ -0,0 +1,91 @@
kind: pipeline
type: docker
name: Test Pipeline
workspace:
path: /drone/auth
steps:
- name: yarn install
image: node:latest
commands:
- yarn install
- name: Code Style Checks
image: node:latest
commands:
- yarn prettier
- name: Lint
image: node:latest
commands:
- yarn lint
- name: Unit Tests
image: node:latest
commands:
- yarn test
- name: Send Test Status Notification
image: plugins/webhook
settings:
urls: https://lab.mifi.dev/hooks/9p65zpagctgkmndo8nwwm4199r
content_type: application/json
template: |
{
"icon_url":"https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/apple/198/freezing-face_1f976.png",
"text": "[{{ repo.name }} - Build # {{ build.number }}] Code Quality Checks {{ build.status }} {{#success build.status}}:tada:{{else}}:poop:{{/success}}",
"username":"DroneBot"
}
when:
status:
- success
- failure
trigger:
branch:
- main
- develop
event:
- pull_request
---
kind: pipeline
type: docker
name: Publish Pipeline
workspace:
path: /drone/auth
steps:
- name: Publish NPM
image: node:20-alpine
failure: ignore
commands:
- yarn publish -t ${DRONE_TAG}
volumes:
- name: npmrc
path: /drone/auth/.npmrc
- name: Report NPM Publish Status
image: plugins/webhook
settings:
urls: https://lab.mifi.dev/hooks/ccw34hdf7tgbjmzp96nptn938r
content_type: application/json
template: |
{
"icon_url":"https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/apple/198/freezing-face_1f976.png",
"text": "[{{ repo.name }} - New npm package release {{tag}} from # {{ build.number }}] Deploy {{ build.status }} {{#success build.status}}:tada:{{else}}:poop:{{/success}}",
"username":"DroneBot"
}
when:
status:
- success
- failure
volumes:
- name: npmrc
host:
path: /volume1/docker/beethoven/labs-auth/.npmrc
depends_on:
- Test Pipeline
trigger:
event:
- tag

View File

@@ -1,5 +1,5 @@
import { Auth, Log } from '..';
import { Action } from '../../constants/action';
import { Action } from '../constants/action';
import { getLoginToken } from '../utils/getLoginToken';
export const authenticate = async (username: string, password: string) => {

View File

@@ -1,7 +1,7 @@
import { readOneByUsername } from '../dao/readOneByUsername';
import { Log, Token } from '..';
import { TokenType } from '../../constants/tokens';
import { Action } from '../../constants/action';
import { TokenType } from '../constants/tokens';
import { Action } from '../constants/action';
export const resetPasswordGet = async (username: string) => {
const doc = await readOneByUsername(username);

View File

@@ -1,11 +1,11 @@
import { Types } from 'mongoose';
import { Log, Strategy, Token } from '..';
import { STRATEGIES } from '../../constants/strategies';
import { STRATEGIES } from '../constants/strategies';
import { AuthDocument } from '../schema/auth';
import { getLoginToken } from '../utils/getLoginToken';
import { StrategyDocument } from '../schema/strategy';
import { Action } from '../../constants/action';
import { Action } from '../constants/action';
export const resetPasswordPost = async (token: string, password: string) => {
const parentId = await Token.validateResetToken(token);

View File

@@ -1,6 +1,6 @@
import mongoose from 'mongoose';
import { DB_HOST, DB_NAME, DB_PASSWORD, DB_PORT, DB_USERNAME } from '../constants/db';
import { DB_HOST, DB_NAME, DB_PASSWORD, DB_PORT, DB_USERNAME } from './constants/db';
import { Auth } from './model/auth';
import { Log } from './model/log';
import { Strategy } from './model/strategy';

View File

@@ -1,6 +1,6 @@
{
"name": "@mifi/auth-db",
"version": "1.0.2",
"version": "1.0.4",
"author": "mifi (Mike Fitzpatrick)",
"license": "MIT",
"scripts": {
@@ -38,7 +38,7 @@
"typescript": "^4.9.5"
},
"dependencies": {
"@mifi/services-common": "1.0.0",
"@mifi/services-common": "1.x.x",
"dotenv": "^16.0.3",
"jsonwebtoken": "^9.0.0",
"mongoose": "^6.9.2"

View File

@@ -2629,7 +2629,7 @@ __metadata:
"@babel/core": ^7.21.8
"@babel/preset-env": ^7.21.5
"@babel/preset-typescript": ^7.21.5
"@mifi/services-common": 1.0.0
"@mifi/services-common": 1.x.x
"@tsconfig/node16": ^1.0.4
"@types/jsonwebtoken": ^9.0.2
"@types/node": ^18.14.0
@@ -2655,10 +2655,10 @@ __metadata:
languageName: unknown
linkType: soft
"@mifi/services-common@npm:1.0.0":
version: 1.0.0
resolution: "@mifi/services-common@npm:1.0.0::__archiveUrl=https%3A%2F%2Fgit.mifi.dev%2Fapi%2Fpackages%2Fmifi%2Fnpm%2F%2540mifi%252Fservices-common%2F-%2F1.0.0%2Fservices-common-1.0.0.tgz"
checksum: 1ab1c697e603df26363a3b6ae77fc35ac19c34a4c43d874ec0fc113a87b2ae62a8ddc64c7d40fb7e38f69c42b0eb9a93df40905eb7fecc92c3665ef18f245bc0
"@mifi/services-common@npm:1.x.x":
version: 1.0.1
resolution: "@mifi/services-common@npm:1.0.1::__archiveUrl=https%3A%2F%2Fgit.mifi.dev%2Fapi%2Fpackages%2Fmifi%2Fnpm%2F%2540mifi%252Fservices-common%2F-%2F1.0.1%2Fservices-common-1.0.1.tgz"
checksum: b8ba60584616826615bf4600dc45a0fbe390a2ff5c1a8238e0f9e016fd2ff069e4c6fd96d4d02af7eb41671436a58ab69e6017301a509a175aeff08d7b056fc2
languageName: node
linkType: hard