8 Commits

Author SHA1 Message Date
1e1eac9dd6 Switch to docker image for deploy
All checks were successful
continuous-integration/drone/pr Build is passing
2023-05-09 20:27:28 -04:00
7a0d5dc48c Merge branch 'release/0.0.37'
# Conflicts:
#	package.json
2023-05-09 19:36:14 -04:00
4ed4b6e5f4 update version
Some checks failed
continuous-integration/drone/pr Build is failing
2023-05-09 19:33:02 -04:00
4499e20e77 - Check that update route is authenticated 2023-05-09 19:28:27 -04:00
fbc1e55e5c Merge branch 'main' of ssh://git.mifi.dev:12022/mifi/auth 2023-05-09 19:15:25 -04:00
653fc7d52f promnotions 2023-05-09 19:15:01 -04:00
84881edb61 promnotions 2023-05-09 19:14:04 -04:00
c8b1b72694 New pipeline eventing 2023-05-09 19:08:17 -04:00
3 changed files with 11 additions and 15 deletions

View File

@@ -61,8 +61,7 @@ trigger:
branch: branch:
- main - main
event: event:
# - pull_request - pull_request
- push
--- ---
kind: pipeline kind: pipeline
@@ -145,10 +144,7 @@ depends_on:
- Test Pipeline - Test Pipeline
trigger: trigger:
# branch:
# - main
event: event:
# - push
- tag - tag
--- ---
@@ -169,10 +165,10 @@ steps:
ROUTE_PREFIX: /auth ROUTE_PREFIX: /auth
PORT: 9001 PORT: 9001
commands: commands:
- docker compose -f docker-compose.staging.yml pull - docker compose -f docker-compose.staging_image.yml pull
- docker compose -f docker-compose.staging.yml build --no-cache - docker compose -f docker-compose.staging_image.yml build --no-cache
- docker compose -f docker-compose.staging.yml rm --stop - docker compose -f docker-compose.staging_image.yml rm --stop
- docker compose -f docker-compose.staging.yml up --wait - docker compose -f docker-compose.staging_image.yml up --wait
volumes: volumes:
- name: env-secrets - name: env-secrets
path: /drone/grow/staging.env path: /drone/grow/staging.env
@@ -212,8 +208,7 @@ depends_on:
- Test Pipeline - Test Pipeline
trigger: trigger:
# branch:
# - main
event: event:
# - push - promote
- tag target:
- production

View File

@@ -7,6 +7,7 @@ import Auth from '../../db/model/auth';
import { sign } from '../../utils/jwt'; import { sign } from '../../utils/jwt';
import passport from '../passport'; import passport from '../passport';
import { ErrorCodes, getErrorBody } from '../../constants/errors'; import { ErrorCodes, getErrorBody } from '../../constants/errors';
import { authenticated } from '../middleware/authenication';
const routerOpts: Router.IRouterOptions = { prefix }; const routerOpts: Router.IRouterOptions = { prefix };
const router: Router = new Router(routerOpts); const router: Router = new Router(routerOpts);
@@ -43,7 +44,7 @@ router.post(process.env.RESET_ROUTE || RESET_ROUTE, async (ctx, next) => {
ctx.body = { success: false, ...getErrorBody(ErrorCodes.RESET_REQUEST_DATA) }; ctx.body = { success: false, ...getErrorBody(ErrorCodes.RESET_REQUEST_DATA) };
}); });
router.patch('/:record', (ctx: Koa.Context) => { router.patch('/:record', authenticated(), (ctx: Koa.Context) => {
const data = Auth.findOneAndUpdate({ record: ctx.params.record }); const data = Auth.findOneAndUpdate({ record: ctx.params.record });
if (!data) { if (!data) {
ctx.throw(StatusCodes.NOT_FOUND); ctx.throw(StatusCodes.NOT_FOUND);

View File

@@ -1,6 +1,6 @@
{ {
"name": "@mifi/auth", "name": "@mifi/auth",
"version": "0.0.35", "version": "0.0.37",
"author": "mifi (Mike Fitzpatrick)", "author": "mifi (Mike Fitzpatrick)",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {