feat: auth + storage config improvements

This commit is contained in:
NGPixel
2018-07-01 19:50:42 -04:00
parent bb102c3356
commit 4643336e9d
35 changed files with 818 additions and 354 deletions

View File

@@ -10,7 +10,11 @@ module.exports = {
key: 'auth0',
title: 'Auth0',
useForm: false,
props: ['domain', 'clientId', 'clientSecret'],
props: {
domain: String,
clientId: String,
clientSecret: String
},
init (passport, conf) {
passport.use('auth0',
new Auth0Strategy({

View File

@@ -10,7 +10,18 @@ module.exports = {
key: 'azure',
title: 'Azure Active Directory',
useForm: false,
props: ['clientId', 'clientSecret', 'resource', 'tenant'],
props: {
clientId: String,
clientSecret: String,
resource: {
type: String,
default: '00000002-0000-0000-c000-000000000000'
},
tenant: {
type: String,
default: 'YOUR_TENANT.onmicrosoft.com'
}
},
init (passport, conf) {
const jwt = require('jsonwebtoken')
passport.use('azure_ad_oauth2',

View File

@@ -10,7 +10,10 @@ module.exports = {
key: 'discord',
title: 'Discord',
useForm: false,
props: ['clientId', 'clientSecret'],
props: {
clientId: String,
clientSecret: String
},
init (passport, conf) {
passport.use('discord',
new DiscordStrategy({

View File

@@ -10,7 +10,10 @@ module.exports = {
key: 'dropbox',
title: 'Dropbox',
useForm: false,
props: ['clientId', 'clientSecret'],
props: {
clientId: String,
clientSecret: String
},
init (passport, conf) {
passport.use('dropbox',
new DropboxStrategy({

View File

@@ -10,7 +10,10 @@ module.exports = {
key: 'facebook',
title: 'Facebook',
useForm: false,
props: ['clientId', 'clientSecret'],
props: {
clientId: String,
clientSecret: String
},
init (passport, conf) {
passport.use('facebook',
new FacebookStrategy({

View File

@@ -10,7 +10,10 @@ module.exports = {
key: 'github',
title: 'GitHub',
useForm: false,
props: ['clientId', 'clientSecret'],
props: {
clientId: String,
clientSecret: String
},
init (passport, conf) {
passport.use('github',
new GitHubStrategy({

View File

@@ -10,7 +10,10 @@ module.exports = {
key: 'google',
title: 'Google',
useForm: false,
props: ['clientId', 'clientSecret'],
props: {
clientId: String,
clientSecret: String
},
init (passport, conf) {
passport.use('google',
new GoogleStrategy({

View File

@@ -11,7 +11,30 @@ module.exports = {
key: 'ldap',
title: 'LDAP / Active Directory',
useForm: true,
props: ['url', 'bindDn', 'bindCredentials', 'searchBase', 'searchFilter', 'tlsEnabled', 'tlsCertPath'],
props: {
url: {
type: String,
default: 'ldap://serverhost:389'
},
bindDn: {
type: String,
default: `cn='root'`
},
bindCredentials: String,
searchBase: {
type: String,
default: 'o=users,o=example.com'
},
searchFilter: {
type: String,
default: '(uid={{username}})'
},
tlsEnabled: {
type: Boolean,
default: false
},
tlsCertPath: String
},
init (passport, conf) {
passport.use('ldapauth',
new LdapStrategy({

View File

@@ -10,7 +10,7 @@ module.exports = {
key: 'local',
title: 'Local',
useForm: true,
props: [],
props: {},
init (passport, conf) {
passport.use('local',
new LocalStrategy({

View File

@@ -10,7 +10,10 @@ module.exports = {
key: 'microsoft',
title: 'Microsoft Account',
useForm: false,
props: ['clientId', 'clientSecret'],
props: {
clientId: String,
clientSecret: String
},
init (passport, conf) {
passport.use('microsoft',
new WindowsLiveStrategy({

View File

@@ -10,7 +10,12 @@ module.exports = {
key: 'oauth2',
title: 'OAuth2',
useForm: false,
props: ['clientId', 'clientSecret', 'authorizationURL', 'tokenURL'],
props: {
clientId: String,
clientSecret: String,
authorizationURL: String,
tokenURL: String
},
init (passport, conf) {
passport.use('oauth2',
new OAuth2Strategy({

View File

@@ -10,7 +10,10 @@ module.exports = {
key: 'slack',
title: 'Slack',
useForm: false,
props: ['clientId', 'clientSecret'],
props: {
clientId: String,
clientSecret: String
},
init (passport, conf) {
passport.use('slack',
new SlackStrategy({

View File

@@ -10,7 +10,10 @@ module.exports = {
key: 'twitch',
title: 'Twitch',
useForm: false,
props: ['clientId', 'clientSecret'],
props: {
clientId: String,
clientSecret: String
},
init (passport, conf) {
passport.use('twitch',
new TwitchStrategy({