2020-05-17 04:55:08 +00:00
|
|
|
const { Model } = require('flitter-orm')
|
|
|
|
|
|
|
|
class ApplicationModel extends Model {
|
|
|
|
static get schema() {
|
|
|
|
return {
|
|
|
|
name: String,
|
|
|
|
identifier: String,
|
|
|
|
description: String,
|
|
|
|
active: { type: Boolean, default: true },
|
|
|
|
saml_service_provider_ids: [String],
|
|
|
|
ldap_client_ids: [String],
|
|
|
|
oauth_client_ids: [String],
|
2020-08-13 06:56:33 +00:00
|
|
|
openid_client_ids: [String],
|
2021-10-24 18:12:58 +00:00
|
|
|
radius_client_ids: [String],
|
2020-05-17 04:55:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
async to_api() {
|
|
|
|
return {
|
|
|
|
id: this.id,
|
|
|
|
name: this.name,
|
|
|
|
identifier: this.identifier,
|
|
|
|
description: this.description,
|
|
|
|
saml_service_provider_ids: this.saml_service_provider_ids,
|
|
|
|
ldap_client_ids: this.ldap_client_ids,
|
|
|
|
oauth_client_ids: this.oauth_client_ids,
|
2020-08-13 06:56:33 +00:00
|
|
|
openid_client_ids: this.openid_client_ids,
|
2021-10-24 18:12:58 +00:00
|
|
|
radius_client_ids: this.radius_client_ids || [],
|
2020-05-17 04:55:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = exports = ApplicationModel
|