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

Allow plugins to opt-in for authentication #657

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

pedro-rosario
Copy link
Contributor

@pedro-rosario pedro-rosario commented May 1, 2019

Feature Info

Description

  • Passes a function (useAuth) to each plugin.

Plugin example

'use strict';

const express = require('express');

module.exports = (router, _pluginDBAdapter, _publish, _sites, _site, useAuth) => {
  const pluginRouter = express.Router();

  useAuth(pluginRouter);
  pluginRouter.use((req, res) => res.json({ method: req.method }));
  router.use('/_test', pluginRouter);
}

Related

clay/amphora-auth#19

TODO

Closes #640

@pedro-rosario pedro-rosario changed the title Allow plugins to opt-in/out of authentication Allow plugins to opt-in for authentication May 1, 2019
@pedro-rosario pedro-rosario added the 8.x Breaking changes for the next major version of Amphora label May 1, 2019
Copy link
Contributor

@manuelurenah manuelurenah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏄

@pedro-rosario
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.x Breaking changes for the next major version of Amphora blocked
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Amphora Plugins Auth Requirement
2 participants