feat: Remove app config relation from app auth clients

This commit is contained in:
Faruk AYDIN
2024-03-26 21:00:14 +01:00
parent 70f30034ab
commit b53ddca8ce

View File

@@ -1,7 +1,6 @@
import AES from 'crypto-js/aes.js';
import enc from 'crypto-js/enc-utf8.js';
import appConfig from '../config/app.js';
import AppConfig from './app-config.js';
import Base from './base.js';
class AppAuthClient extends Base {
@@ -9,12 +8,11 @@ class AppAuthClient extends Base {
static jsonSchema = {
type: 'object',
required: ['name', 'appKey', 'appConfigId', 'formattedAuthDefaults'],
required: ['name', 'appKey', 'formattedAuthDefaults'],
properties: {
id: { type: 'string', format: 'uuid' },
appKey: { type: 'string' },
appConfigId: { type: 'string', format: 'uuid' },
active: { type: 'boolean' },
authDefaults: { type: ['string', 'null'] },
formattedAuthDefaults: { type: 'object' },
@@ -23,17 +21,6 @@ class AppAuthClient extends Base {
},
};
static relationMappings = () => ({
appConfig: {
relation: Base.BelongsToOneRelation,
modelClass: AppConfig,
join: {
from: 'app_auth_clients.app_config_id',
to: 'app_configs.id',
},
},
});
encryptData() {
if (!this.eligibleForEncryption()) return;