Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(deps): Upgraded Lodash and added GitHub Actions #1

Merged
merged 10 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x, 18.x, 20.x]

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install Dependencies
run: yarn install

- name: Run Tests
run: yarn test
5 changes: 0 additions & 5 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# secure
ACL for Node.JS. Including authentication and express middleware for authorization.

[![build status](https://secure.travis-ci.org/domharrington/secure.png)](http://travis-ci.org/domharrington/secure)
[![CI](https://github.com/clocklimited/secure/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/clocklimited/secure/actions/workflows/ci.yml)

## Installation

Expand Down
4 changes: 2 additions & 2 deletions access-control-list.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var _ = require('lodash')
var assignIn = require('lodash/assignIn')
;

module.exports = function(logger) {
Expand Down Expand Up @@ -46,7 +46,7 @@ module.exports = function(logger) {
actions: ['create', 'read', 'update', 'delete', '*']
};

_.extend(options, resourceOptions);
assignIn(options, resourceOptions);

if (!Array.isArray(options.actions)) {
throw new TypeError('actionList is excepted to be an array of action ' +
Expand Down
4 changes: 2 additions & 2 deletions access-control.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var events = require('events')
, _ = require('lodash')
, assignIn = require('lodash/assignIn')
;

/**
Expand Down Expand Up @@ -224,7 +224,7 @@ module.exports = function(authenticationProvider, authenticatedAcl, unauthentica
return req.session[type + 'LastUrl'];
}

return _.extend(self, {
return assignIn(self, {
createSession: createSession,
authenticate: authenticate,
isAuthenticated: isAuthenticated,
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
],
"repository": {
"type": "git",
"url": "[email protected]:domharrington/secure"
"url": "[email protected]:clocklimited/secure"
},
"publishConfig": {
"registry": "https://registry.npmjs.org"
Expand All @@ -22,13 +22,13 @@
"test": "mocha -r should"
},
"engines": {
"node": ">0.6.0"
"node": ">10.0.0"
},
"dependencies": {
"lodash": "0.9.0"
"lodash": "^4.17.21"
},
"devDependencies": {
"mocha": "*",
"should": "*"
"mocha": "^10.2.0",
"should": "^13.2.3"
}
}
8 changes: 4 additions & 4 deletions test/secure.tests.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var _ = require('lodash')
var assignIn = require('lodash/assignIn')
;

function getAcl(resource) {
Expand Down Expand Up @@ -289,7 +289,7 @@ function getAccessControl(options) {

options = options || {};

options = _.extend({
options = assignIn({
authenticationProvider: emptyFn,
authenticatedAcl: getAcl(),
unauthenticatedAcl: getAcl(),
Expand Down Expand Up @@ -434,7 +434,7 @@ describe('access-control', function() {

function authenticate(credentials, callback) {
if (credentials.emailAddress === '[email protected]') {
callback(null, _.extend(getUser(), { authenticationId: 'test-auth-id' }));
callback(null, assignIn(getUser(), { authenticationId: 'test-auth-id' }));
} else {
callback(new Error('Wrong Email and password combination.'));
}
Expand Down Expand Up @@ -498,7 +498,7 @@ describe('access-control', function() {
accessControl.authenticate(
getMockRequest(),
response,
_.extend(user, { rememberMe: true }),
assignIn(user, { rememberMe: true }),
function() {
var cookie = response.getCookie();

Expand Down
Loading
Loading