Flesh out Cobalt, LDAP groups, &c.
This commit is contained in:
@@ -2,23 +2,13 @@ const { Controller } = require('libflitter')
|
||||
|
||||
class SAMLController extends Controller {
|
||||
static get services() {
|
||||
return [...super.services, 'cobalt', 'models']
|
||||
return [...super.services, 'cobalt']
|
||||
}
|
||||
|
||||
async get_sp_listing(req, res, next) {
|
||||
const ServiceProvider = this.models.get('saml:ServiceProvider')
|
||||
const service_providers = await ServiceProvider.find()
|
||||
const formatted = service_providers.map(x => {
|
||||
return {
|
||||
name: x.name,
|
||||
entity_id: x.entity_id,
|
||||
acs_url: x.acs_url,
|
||||
has_slo: !!x.slo_url,
|
||||
}
|
||||
})
|
||||
|
||||
return this.cobalt.listing(req, res, {
|
||||
title: 'SAML Service Providers',
|
||||
resource: 'saml/Provider',
|
||||
columns: [
|
||||
{
|
||||
name: 'Provider Name',
|
||||
@@ -38,7 +28,49 @@ class SAMLController extends Controller {
|
||||
field: 'acs_url',
|
||||
},
|
||||
],
|
||||
data: formatted,
|
||||
actions: [
|
||||
{
|
||||
type: 'resource',
|
||||
position: 'main',
|
||||
action: 'insert',
|
||||
text: 'Create New',
|
||||
color: 'success',
|
||||
},
|
||||
],
|
||||
})
|
||||
}
|
||||
|
||||
async get_sp_form(req, res, next) {
|
||||
return this.cobalt.form(req, res, {
|
||||
item: 'SAML Service Provider',
|
||||
plural: 'SAML Service Providers',
|
||||
resource: 'saml/Provider',
|
||||
...(req.params.id ? { existing_id: req.params.id } : {}),
|
||||
fields: [
|
||||
{
|
||||
name: 'Provider Name',
|
||||
field: 'name',
|
||||
placeholder: 'Awesome External App',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: 'Entity ID',
|
||||
field: 'entity_id',
|
||||
placeholder: 'https://my.awesome.app/saml/metadata.xml',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: 'Assertion Consumer Service URL',
|
||||
field: 'acs_url',
|
||||
placeholder: 'https://my.awesome.app/saml/acs',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: 'Single-Logout URL',
|
||||
field: 'slo_url',
|
||||
placeholder: 'https://my.awesome.app/saml/logout',
|
||||
},
|
||||
],
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user