Skip to content

Commit

Permalink
Release v1.0.3
Browse files Browse the repository at this point in the history
- ci: replace travis & appveyor with github actions
- ci: add submodule .release
  • Loading branch information
msimerson authored Jun 5, 2022
2 parents 28b4628 + 4dbec35 commit ac68aad
Show file tree
Hide file tree
Showing 13 changed files with 119 additions and 79 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
allow:
- dependency-type: production
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI

on: [ push ]

env:
CI: true

jobs:

lint:
uses: haraka/.github/.github/workflows/lint.yml@master

# coverage:
# uses: haraka/.github/.github/workflows/coverage.yml@master
# secrets: inherit

test:
needs: [ lint, get-lts ]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest ]
node-version: ${{ fromJson(needs.get-lts.outputs.active) }}
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
name: Node ${{ matrix.node-version }} on ${{ matrix.os }}
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test

get-lts:
runs-on: ubuntu-latest
steps:
- id: get
uses: msimerson/node-lts-versions@v1
outputs:
active: ${{ steps.get.outputs.active }}
lts: ${{ steps.get.outputs.lts }}
13 changes: 13 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: "CodeQL"

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: '18 7 * * 4'

jobs:
codeql:
uses: haraka/.github/.github/workflows/codeql.yml@master
14 changes: 14 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: publish

on:
push:
branches:
- master

env:
CI: true

jobs:
publish:
uses: haraka/.github/.github/workflows/publish.yml@master
secrets: inherit
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ jspm_packages

# Optional REPL history
.node_repl_history

package-lock.json
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule ".release"]
path = .release
url = [email protected]:msimerson/.release.git
1 change: 1 addition & 0 deletions .release
Submodule .release added at 20e8e5
28 changes: 0 additions & 28 deletions .travis.yml

This file was deleted.

11 changes: 11 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@

### Unreleased

### [1.0.3] - 2022-06-05

- ci: replace travis & appveyor with github actions
- ci: add submodule .release


# 1.0.1 - 2018-10-23

- Added support for custom root CAs
Expand All @@ -7,3 +15,6 @@
# 1.0.0 - 2018-10-21

- initial release


[1.0.3]: https://github.com/haraka/haraka-plugin-auth-imap/releases/tag/1.0.3
13 changes: 2 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
[![Build Status][ci-img]][ci-url]
[![Code Climate][clim-img]][clim-url]
[![Greenkeeper badge][gk-img]][gk-url]
[![NPM][npm-img]][npm-url]
<!-- requires URL update [![Windows Build Status][ci-win-img]][ci-win-url] -->
<!-- doesn't work in haraka plugins... yet. [![Code Coverage][cov-img]][cov-url]-->

# haraka-plugin-auth-imap

Expand Down Expand Up @@ -64,15 +61,9 @@ to be declared. Example:


<!-- leave these buried at the bottom of the document -->
[ci-img]: https://travis-ci.org/haraka/haraka-plugin-auth-imap.svg
[ci-url]: https://travis-ci.org/haraka/haraka-plugin-auth-imap
[ci-win-img]: https://ci.appveyor.com/api/projects/status/CHANGETHIS?svg=true
[ci-win-url]: https://ci.appveyor.com/project/haraka/haraka-CHANGETHIS
[cov-img]: https://codecov.io/github/haraka/haraka-plugin-auth-imap/coverage.svg
[cov-url]: https://codecov.io/github/haraka/haraka-plugin-auth-imap
[ci-img]: https://github.com/haraka/haraka-plugin-auth-imap/actions/workflows/ci.yml/badge.svg
[ci-url]: https://github.com/haraka/haraka-plugin-auth-imap/actions/workflows/ci.yml
[clim-img]: https://codeclimate.com/github/haraka/haraka-plugin-auth-imap/badges/gpa.svg
[clim-url]: https://codeclimate.com/github/haraka/haraka-plugin-auth-imap
[gk-img]: https://badges.greenkeeper.io/haraka/haraka-plugin-auth-imap.svg
[gk-url]: https://greenkeeper.io/
[npm-img]: https://nodei.co/npm/haraka-plugin-auth-imap.png
[npm-url]: https://www.npmjs.com/package/haraka-plugin-auth-imap
18 changes: 0 additions & 18 deletions appveyor.yml

This file was deleted.

28 changes: 14 additions & 14 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ exports.hook_capabilities = function (next, connection) {
// Don't offer AUTH capabilities by default unless session is encrypted
if (connection.tls.enabled) {
const methods = ['PLAIN', 'LOGIN'];
connection.capabilities.push('AUTH ' + methods.join(' '));
connection.capabilities.push(`AUTH ${ methods.join(' ')}`);
connection.notes.allowed_auth_methods = methods;
}
next();
Expand All @@ -53,7 +53,7 @@ exports.check_plain_passwd = function (connection, user, passwd, cb) {
}

const config = {
user: user,
user,
password: passwd,
host: 'localhost',
port: 143,
Expand Down Expand Up @@ -90,33 +90,33 @@ exports.check_plain_passwd = function (connection, user, passwd, cb) {

if (sect.users) {
if (sect.users.split(/\s*,\s*/).indexOf((user.split('@'))[0]) < 0) {
connection.loginfo(plugin, 'AUTH user="' + user +
'" is not allowed to authenticate by imap'
connection.loginfo(plugin, `AUTH user="${ user
}" is not allowed to authenticate by imap`
);
return cb(false);
}
}

const client = new plugin.imap(config);

let message = 'section="' + section_name + '" host="' +
config.host + '" port="' + config.port + '" tls=' + config.tls;
let message = `section="${ section_name }" host="${
config.host }" port="${ config.port }" tls=${ config.tls}`;
if (config.tlsOptions) {
message += ' rejectUnauthorized=' + config.tlsOptions
.rejectUnauthorized;
message += ` rejectUnauthorized=${ config.tlsOptions
.rejectUnauthorized}`;
}
if (config.connTimeout) {
message += ' connTimeout=' + config.connTimeout;
message += ` connTimeout=${ config.connTimeout}`;
}
if (config.authTimeout) {
message += ' authTimeout=' + config.authTimeout;
message += ` authTimeout=${ config.authTimeout}`;
}
connection.logdebug(plugin, message);

client.once('ready', function () {

connection.loginfo(plugin, 'AUTH user="' + user +
'" success=true');
connection.loginfo(plugin, `AUTH user="${ user
}" success=true`);
if (trace_imap) {
connection.logdebug(plugin, client);
}
Expand All @@ -125,8 +125,8 @@ exports.check_plain_passwd = function (connection, user, passwd, cb) {
});

client.once('error', function (err) {
connection.loginfo(plugin, 'AUTH user="' + user +
'" success=false error="' + err.message + '"');
connection.loginfo(plugin, `AUTH user="${ user
}" success=false error="${ err.message }"`);
if (trace_imap) {
connection.logdebug(plugin, client);
}
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "haraka-plugin-auth-imap",
"version": "1.0.1",
"description": "Haraka plugin that frobnicates email connections",
"version": "1.0.3",
"description": "Haraka plugin that authenticates against an IMAP server",
"main": "index.js",
"scripts": {
"lint": "./node_modules/.bin/eslint *.js test/**/*.js",
"lintfix": "./node_modules/.bin/eslint --fix *.js test/**/*.js",
"test": "./node_modules/.bin/mocha"
"lint": "npx eslint *.js test",
"lintfix": "npx eslint --fix *.js test",
"test": "npx mocha"
},
"repository": {
"type": "git",
Expand All @@ -17,16 +17,16 @@
"plugin",
"auth-imap"
],
"author": "Welcome Member <happy-haraka-hacker@example.com>",
"author": "Haraka <haraka.mail@gmail.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/haraka/haraka-plugin-auth-imap/issues"
},
"homepage": "https://github.com/haraka/haraka-plugin-auth-imap#readme",
"devDependencies": {
"eslint": ">=3",
"eslint": ">=8",
"eslint-plugin-haraka": "*",
"haraka-test-fixtures": "*",
"mocha": "*"
"mocha": ">=9"
}
}

0 comments on commit ac68aad

Please sign in to comment.