Reformat codebase with trailing commas in functions (#2006)
* style: 💄 Update trailing commas in API * style: 💄 Update trailing commas in core * style: 💄 Update trailing commas in rose * style: 💄 Update trailing commas in admin * style: 💄 Update trailing commas in desktop
This commit is contained in:
1 parent
cb3a9e3bdc
commit
bcf004b8a4
423 files changed
+1636
-1605
No files matched your search
@@ -18,7 +18,7 @@ export default class ChannelRecordingAbility extends ModelAbility {
|
||||
const sessionRecording = this.model.connection_recording.session_recording;
|
||||
const sessionRecordingAbility = this.abilities.abilityFor(
|
||||
'session-recording',
|
||||
sessionRecording
|
||||
sessionRecording,
|
||||
);
|
||||
|
||||
return this.model.isAsciicast && sessionRecordingAbility.canDownload;
|
||||
|
||||
@@ -54,7 +54,7 @@ export default class RoleAbility extends ModelAbility {
|
||||
type === 'user' || type === 'group' || type === 'managed-group';
|
||||
if (!typeIsValid)
|
||||
throw new InvalidRolePrincipalTypeError(
|
||||
`Expected a role principal of type 'user', 'group', or 'managed-group'. Got '${type}'.`
|
||||
`Expected a role principal of type 'user', 'group', or 'managed-group'. Got '${type}'.`,
|
||||
);
|
||||
return this.can.can(`read ${type}`, this.model);
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ function prenormalizeArrayResponse(response) {
|
||||
}
|
||||
|
||||
export default class ApplicationAdapter extends RESTAdapter.extend(
|
||||
AdapterBuildURLMixin
|
||||
AdapterBuildURLMixin,
|
||||
) {
|
||||
// =attributes
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ export default class SessionRecordingAdapter extends ApplicationAdapter {
|
||||
throw this.handleResponse(
|
||||
response.status,
|
||||
response.headers,
|
||||
await response.text()
|
||||
await response.text(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ export default class AccountModel extends GeneratedAccountModel {
|
||||
changePassword(
|
||||
currentPassword,
|
||||
newPassword,
|
||||
options = { adapterOptions: {} }
|
||||
options = { adapterOptions: {} },
|
||||
) {
|
||||
const defaultAdapterOptions = {
|
||||
method: 'change-password',
|
||||
|
||||
@@ -138,7 +138,7 @@ export default class RoleModel extends GeneratedRoleModel {
|
||||
const authMethods = this.resourceFilterStore.queryBy(
|
||||
'auth-method',
|
||||
{ type: [TYPE_AUTH_METHOD_OIDC, TYPE_AUTH_METHOD_LDAP] },
|
||||
{ scope_id: 'global', recursive: true }
|
||||
{ scope_id: 'global', recursive: true },
|
||||
);
|
||||
|
||||
// For each auth method, query all managed groups with IDs
|
||||
@@ -149,9 +149,9 @@ export default class RoleModel extends GeneratedRoleModel {
|
||||
methods.map(({ id: auth_method_id }) =>
|
||||
this.resourceFilterStore
|
||||
.queryBy('managed-group', { id: ids }, { auth_method_id })
|
||||
.then((models) => models.map((model) => model))
|
||||
)
|
||||
)
|
||||
.then((models) => models.map((model) => model)),
|
||||
),
|
||||
),
|
||||
)
|
||||
// The result is an array of arrays of model instances (grouped by
|
||||
// auth methods), so these must be flattened.
|
||||
|
||||
@@ -76,7 +76,7 @@ class SessionCredential {
|
||||
if (this.#payloadSecret?.decoded) {
|
||||
const secretJSON = this.#payloadSecret.decoded;
|
||||
return Object.keys(secretJSON).map(
|
||||
(key) => new SessionCredential.SecretItem(key, secretJSON[key])
|
||||
(key) => new SessionCredential.SecretItem(key, secretJSON[key]),
|
||||
);
|
||||
} else {
|
||||
// decode from base64
|
||||
|
||||
@@ -122,7 +122,7 @@ export default class TargetModel extends GeneratedTargetModel {
|
||||
*/
|
||||
get isActive() {
|
||||
const pendingOrActiveSessions = this.sessions.filter(
|
||||
(s) => s.isActive || s.isPending
|
||||
(s) => s.isActive || s.isPending,
|
||||
);
|
||||
return Boolean(pendingOrActiveSessions.length);
|
||||
}
|
||||
@@ -195,7 +195,7 @@ export default class TargetModel extends GeneratedTargetModel {
|
||||
*/
|
||||
addBrokeredCredentialSources(
|
||||
brokeredCredentialSourceIDs,
|
||||
options = { adapterOptions: {} }
|
||||
options = { adapterOptions: {} },
|
||||
) {
|
||||
const defaultAdapterOptions = {
|
||||
method: 'add-credential-sources',
|
||||
@@ -221,7 +221,7 @@ export default class TargetModel extends GeneratedTargetModel {
|
||||
*/
|
||||
addInjectedApplicationCredentialSources(
|
||||
injectedApplicationCredentialSourceIDs,
|
||||
options = { adapterOptions: {} }
|
||||
options = { adapterOptions: {} },
|
||||
) {
|
||||
const defaultAdapterOptions = {
|
||||
method: 'add-credential-sources',
|
||||
@@ -247,7 +247,7 @@ export default class TargetModel extends GeneratedTargetModel {
|
||||
*/
|
||||
removeBrokeredCredentialSources(
|
||||
brokeredCredentialSourceIDs,
|
||||
options = { adapterOptions: {} }
|
||||
options = { adapterOptions: {} },
|
||||
) {
|
||||
const defaultAdapterOptions = {
|
||||
method: 'remove-credential-sources',
|
||||
@@ -272,7 +272,7 @@ export default class TargetModel extends GeneratedTargetModel {
|
||||
removeBrokeredCredentialSource(brokeredCredentialSourceID, options) {
|
||||
return this.removeBrokeredCredentialSources(
|
||||
[brokeredCredentialSourceID],
|
||||
options
|
||||
options,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -286,7 +286,7 @@ export default class TargetModel extends GeneratedTargetModel {
|
||||
*/
|
||||
removeInjectedApplicationCredentialSources(
|
||||
injectedApplicationCredentialSourceIDs,
|
||||
options = { adapterOptions: {} }
|
||||
options = { adapterOptions: {} },
|
||||
) {
|
||||
const defaultAdapterOptions = {
|
||||
method: 'remove-credential-sources',
|
||||
@@ -310,11 +310,11 @@ export default class TargetModel extends GeneratedTargetModel {
|
||||
*/
|
||||
removeInjectedApplicationCredentialSource(
|
||||
injectedApplicationCredentialSourceID,
|
||||
options
|
||||
options,
|
||||
) {
|
||||
return this.removeInjectedApplicationCredentialSources(
|
||||
[injectedApplicationCredentialSourceID],
|
||||
options
|
||||
options,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ export default class WorkerModel extends GeneratedWorkerModel {
|
||||
|
||||
return Object.values(this.config_tags).reduce(
|
||||
(previousCount, currentTags) => previousCount + currentTags.length,
|
||||
0
|
||||
0,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ export default class WorkerModel extends GeneratedWorkerModel {
|
||||
}
|
||||
|
||||
return Object.entries(this.config_tags).flatMap(([key, value]) =>
|
||||
value.map((tag) => ({ key, value: tag }))
|
||||
value.map((tag) => ({ key, value: tag })),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ export default class AccountSerializer extends ApplicationSerializer {
|
||||
serialized = this.serializeForChangePassword(
|
||||
snapshot,
|
||||
currentPassword,
|
||||
newPassword
|
||||
newPassword,
|
||||
);
|
||||
}
|
||||
return serialized;
|
||||
|
||||
@@ -145,7 +145,7 @@ export default class ApplicationSerializer extends RESTSerializer {
|
||||
const transformedPayload = {};
|
||||
// Find the Ember-data-expected root key name.
|
||||
const payloadKey = this.payloadKeyFromModelName(
|
||||
primaryModelClass.modelName
|
||||
primaryModelClass.modelName,
|
||||
);
|
||||
// Copy the data rooted under `items` in the existing payload into the new
|
||||
// payload under the expected root key name.
|
||||
@@ -156,7 +156,7 @@ export default class ApplicationSerializer extends RESTSerializer {
|
||||
primaryModelClass,
|
||||
transformedPayload,
|
||||
id,
|
||||
requestType
|
||||
requestType,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ export default class ApplicationSerializer extends RESTSerializer {
|
||||
const transformedPayload = {};
|
||||
// Find the Ember-data-expected root key name.
|
||||
const payloadKey = this.payloadKeyFromModelName(
|
||||
primaryModelClass.modelName
|
||||
primaryModelClass.modelName,
|
||||
);
|
||||
// Copy the unrooted payload under the expected root key name.
|
||||
transformedPayload[payloadKey] = payload;
|
||||
@@ -193,7 +193,7 @@ export default class ApplicationSerializer extends RESTSerializer {
|
||||
primaryModelClass,
|
||||
transformedPayload,
|
||||
id,
|
||||
requestType
|
||||
requestType,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -318,7 +318,7 @@ export default class ApplicationSerializer extends RESTSerializer {
|
||||
primaryModelClass,
|
||||
payload,
|
||||
id,
|
||||
requestType
|
||||
requestType,
|
||||
) {
|
||||
const newPayload = structuredClone(payload);
|
||||
|
||||
@@ -338,7 +338,7 @@ export default class ApplicationSerializer extends RESTSerializer {
|
||||
primaryModelClass,
|
||||
newPayload,
|
||||
id,
|
||||
requestType
|
||||
requestType,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -74,7 +74,7 @@ export default class AuthMethodSerializer extends ApplicationSerializer {
|
||||
normalizeArrayResponse() {
|
||||
const normalized = super.normalizeArrayResponse(...arguments);
|
||||
normalized.data = normalized.data.sort((a) =>
|
||||
a.attributes.is_primary ? -1 : 1
|
||||
a.attributes.is_primary ? -1 : 1,
|
||||
);
|
||||
return normalized;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import ApplicationSerializer from './application';
|
||||
import { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';
|
||||
|
||||
export default class ConnectionSerializer extends ApplicationSerializer.extend(
|
||||
EmbeddedRecordsMixin
|
||||
EmbeddedRecordsMixin,
|
||||
) {
|
||||
attrs = {
|
||||
channel_recordings: { embedded: 'always' },
|
||||
|
||||
@@ -24,7 +24,7 @@ export default class CredentialSerializer extends ApplicationSerializer {
|
||||
|
||||
if (serialized?.attributes?.json_object) {
|
||||
serialized.attributes.object = JSON.parse(
|
||||
serialized.attributes.json_object
|
||||
serialized.attributes.json_object,
|
||||
);
|
||||
delete serialized.attributes.json_object;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import ApplicationSerializer from './application';
|
||||
import { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';
|
||||
export default class RecordingSerializer extends ApplicationSerializer.extend(
|
||||
EmbeddedRecordsMixin
|
||||
EmbeddedRecordsMixin,
|
||||
) {
|
||||
attrs = {
|
||||
connection_recordings: { embedded: 'always' },
|
||||
|
||||
@@ -36,12 +36,12 @@ export default class TargetSerializer extends ApplicationSerializer {
|
||||
if (brokeredCredentialSourceIDs)
|
||||
serialized = this.serializeWithBrokeredCredentialSources(
|
||||
snapshot,
|
||||
brokeredCredentialSourceIDs
|
||||
brokeredCredentialSourceIDs,
|
||||
);
|
||||
if (injectedApplicationCredentialSourceIDs)
|
||||
serialized = this.serializeWithInjectedApplicationCredentialSources(
|
||||
snapshot,
|
||||
injectedApplicationCredentialSourceIDs
|
||||
injectedApplicationCredentialSourceIDs,
|
||||
);
|
||||
|
||||
// Delete session recording related fields from non-SSH targets
|
||||
@@ -75,7 +75,7 @@ export default class TargetSerializer extends ApplicationSerializer {
|
||||
*/
|
||||
serializeWithBrokeredCredentialSources(
|
||||
snapshot,
|
||||
brokered_credential_source_ids
|
||||
brokered_credential_source_ids,
|
||||
) {
|
||||
return {
|
||||
version: snapshot.attr('version'),
|
||||
@@ -92,7 +92,7 @@ export default class TargetSerializer extends ApplicationSerializer {
|
||||
*/
|
||||
serializeWithInjectedApplicationCredentialSources(
|
||||
snapshot,
|
||||
injected_application_credential_source_ids
|
||||
injected_application_credential_source_ids,
|
||||
) {
|
||||
return {
|
||||
version: snapshot.attr('version'),
|
||||
|
||||
@@ -22,7 +22,7 @@ export default class WorkerSerializer extends ApplicationSerializer {
|
||||
if (workerGeneratedAuthToken)
|
||||
serialized = this.serializeWithGeneratedToken(
|
||||
snapshot,
|
||||
workerGeneratedAuthToken
|
||||
workerGeneratedAuthToken,
|
||||
);
|
||||
return serialized;
|
||||
}
|
||||
|
||||
@@ -42,8 +42,8 @@ export class ResourceFilter {
|
||||
return this.in(value.contains, key);
|
||||
}
|
||||
return this.equals(key, value);
|
||||
})
|
||||
)
|
||||
}),
|
||||
),
|
||||
);
|
||||
})
|
||||
.flat()
|
||||
|
||||
+36
-36
@@ -74,7 +74,7 @@ function routes() {
|
||||
});
|
||||
}
|
||||
return resultSet.filter(makeBooleanFilter(filter));
|
||||
}
|
||||
},
|
||||
);
|
||||
this.post('/scopes', function ({ scopes }) {
|
||||
// Parent scope comes through the payload via `scope_id`, but this needs
|
||||
@@ -107,11 +107,11 @@ function routes() {
|
||||
});
|
||||
} else {
|
||||
resultSet = authMethods.where(
|
||||
(authMethod) => authMethod.scopeId === scope_id
|
||||
(authMethod) => authMethod.scopeId === scope_id,
|
||||
);
|
||||
}
|
||||
return resultSet.filter(makeBooleanFilter(filter));
|
||||
}
|
||||
},
|
||||
);
|
||||
this.post('/auth-methods', function ({ authMethods }) {
|
||||
const attrs = this.normalizedRequestAttrs();
|
||||
@@ -130,7 +130,7 @@ function routes() {
|
||||
}
|
||||
|
||||
return authMethods.find(id).update(attrs);
|
||||
}
|
||||
},
|
||||
);
|
||||
this.del('/auth-methods/:id', ({ authMethods }, { params: { id } }) => {
|
||||
const authMethod = authMethods.find(id);
|
||||
@@ -149,7 +149,7 @@ function routes() {
|
||||
'/accounts',
|
||||
(
|
||||
{ accounts },
|
||||
{ queryParams: { auth_method_id: authMethodId, filter } }
|
||||
{ queryParams: { auth_method_id: authMethodId, filter } },
|
||||
) => {
|
||||
let resultSet;
|
||||
if (authMethodId) {
|
||||
@@ -158,7 +158,7 @@ function routes() {
|
||||
resultSet = accounts.all();
|
||||
}
|
||||
return resultSet.filter(makeBooleanFilter(filter));
|
||||
}
|
||||
},
|
||||
);
|
||||
this.post('/accounts');
|
||||
this.get('/accounts/:id');
|
||||
@@ -184,7 +184,7 @@ function routes() {
|
||||
updatedAttrs.attributes.password = attrs.new_password;
|
||||
}
|
||||
return account.update(updatedAttrs);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
// Authenticate + auth methods custom routes
|
||||
@@ -211,7 +211,7 @@ function routes() {
|
||||
resultSet = users.where((user) => user.scopeId === scope_id);
|
||||
}
|
||||
return resultSet.filter(makeBooleanFilter(filter));
|
||||
}
|
||||
},
|
||||
);
|
||||
this.post('/users');
|
||||
this.get('/users/:id');
|
||||
@@ -262,7 +262,7 @@ function routes() {
|
||||
resultSet = groups.where((group) => group.scopeId === scope_id);
|
||||
}
|
||||
return resultSet.filter(makeBooleanFilter(filter));
|
||||
}
|
||||
},
|
||||
);
|
||||
this.post('/groups');
|
||||
this.get('/groups/:id');
|
||||
@@ -294,7 +294,7 @@ function routes() {
|
||||
});
|
||||
}
|
||||
return group.update(updatedAttrs);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
// IAM: Roles
|
||||
@@ -309,7 +309,7 @@ function routes() {
|
||||
'/roles/:idMethod',
|
||||
function (
|
||||
{ roles, users, groups, managedGroups },
|
||||
{ params: { idMethod } }
|
||||
{ params: { idMethod } },
|
||||
) {
|
||||
const attrs = this.normalizedRequestAttrs();
|
||||
const id = idMethod.split(':')[0];
|
||||
@@ -361,7 +361,7 @@ function routes() {
|
||||
updatedAttrs.managedGroupIds = updatedAttrs.managedGroupIds.filter(
|
||||
(id) => {
|
||||
return !attrs.principalIds.includes(id);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -373,7 +373,7 @@ function routes() {
|
||||
}
|
||||
|
||||
return role.update(updatedAttrs);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
// Other resources
|
||||
@@ -383,7 +383,7 @@ function routes() {
|
||||
'/host-catalogs',
|
||||
({ hostCatalogs }, { queryParams: { scope_id: scopeId } }) => {
|
||||
return hostCatalogs.where({ scopeId });
|
||||
}
|
||||
},
|
||||
);
|
||||
this.post(
|
||||
'/host-catalogs',
|
||||
@@ -396,7 +396,7 @@ function routes() {
|
||||
};
|
||||
}
|
||||
return hostCatalogs.create(attrs);
|
||||
}
|
||||
},
|
||||
);
|
||||
this.get('/host-catalogs/:id');
|
||||
this.patch('/host-catalogs/:id');
|
||||
@@ -408,7 +408,7 @@ function routes() {
|
||||
'/hosts',
|
||||
function ({ hosts }, { queryParams: { host_catalog_id: hostCatalogId } }) {
|
||||
return hosts.where({ hostCatalogId });
|
||||
}
|
||||
},
|
||||
);
|
||||
this.post('/hosts', function ({ hostCatalogs, hosts }) {
|
||||
const attrs = this.normalizedRequestAttrs();
|
||||
@@ -426,10 +426,10 @@ function routes() {
|
||||
'/host-sets',
|
||||
function (
|
||||
{ hostSets },
|
||||
{ queryParams: { host_catalog_id: hostCatalogId } }
|
||||
{ queryParams: { host_catalog_id: hostCatalogId } },
|
||||
) {
|
||||
return hostSets.where({ hostCatalogId });
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
this.post('/host-sets', function ({ hostCatalogs, hostSets }) {
|
||||
@@ -477,7 +477,7 @@ function routes() {
|
||||
}
|
||||
|
||||
return hostSet.update(updatedAttrs);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
// target
|
||||
@@ -500,7 +500,7 @@ function routes() {
|
||||
resultSet = targets.where((target) => target.scopeId === scope_id);
|
||||
}
|
||||
return resultSet.filter(makeBooleanFilter(filter));
|
||||
}
|
||||
},
|
||||
);
|
||||
this.post('/targets', function ({ targets }) {
|
||||
const attrs = this.normalizedRequestAttrs();
|
||||
@@ -548,7 +548,7 @@ function routes() {
|
||||
resultSet = sessions.where((session) => session.scopeId === scope_id);
|
||||
}
|
||||
return resultSet.filter(makeBooleanFilter(filter));
|
||||
}
|
||||
},
|
||||
);
|
||||
this.get('/sessions/:id', function ({ sessions }, { params: { id } }) {
|
||||
const session = sessions.find(id);
|
||||
@@ -573,7 +573,7 @@ function routes() {
|
||||
updatedAttrs.status = 'canceling';
|
||||
}
|
||||
return session.update(updatedAttrs);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
// auth-tokens
|
||||
@@ -589,7 +589,7 @@ function routes() {
|
||||
this.get(
|
||||
'/credential-stores',
|
||||
({ credentialStores }, { queryParams: { scope_id: scopeId } }) =>
|
||||
credentialStores.where({ scopeId })
|
||||
credentialStores.where({ scopeId }),
|
||||
);
|
||||
|
||||
this.get('/credential-stores/:id');
|
||||
@@ -603,8 +603,8 @@ function routes() {
|
||||
'/credential-libraries',
|
||||
(
|
||||
{ credentialLibraries },
|
||||
{ queryParams: { credential_store_id: credentialStoreId } }
|
||||
) => credentialLibraries.where({ credentialStoreId })
|
||||
{ queryParams: { credential_store_id: credentialStoreId } },
|
||||
) => credentialLibraries.where({ credentialStoreId }),
|
||||
);
|
||||
this.get('/credential-libraries/:id');
|
||||
this.post(
|
||||
@@ -614,7 +614,7 @@ function routes() {
|
||||
const credentialStore = credentialStores.find(attrs.credentialStoreId);
|
||||
attrs.scopeId = credentialStore.scope.id;
|
||||
return credentialLibraries.create(attrs);
|
||||
}
|
||||
},
|
||||
);
|
||||
this.del('/credential-libraries/:id');
|
||||
this.patch('/credential-libraries/:id');
|
||||
@@ -625,8 +625,8 @@ function routes() {
|
||||
'/credentials',
|
||||
(
|
||||
{ credentials },
|
||||
{ queryParams: { credential_store_id: credentialStoreId } }
|
||||
) => credentials.where({ credentialStoreId })
|
||||
{ queryParams: { credential_store_id: credentialStoreId } },
|
||||
) => credentials.where({ credentialStoreId }),
|
||||
);
|
||||
this.get('/credentials/:id');
|
||||
this.post('/credentials', function ({ credentialStores, credentials }) {
|
||||
@@ -644,7 +644,7 @@ function routes() {
|
||||
'/managed-groups',
|
||||
(
|
||||
{ managedGroups },
|
||||
{ queryParams: { auth_method_id: authMethodId, filter } }
|
||||
{ queryParams: { auth_method_id: authMethodId, filter } },
|
||||
) => {
|
||||
let resultSet;
|
||||
if (authMethodId) {
|
||||
@@ -653,7 +653,7 @@ function routes() {
|
||||
resultSet = managedGroups.all();
|
||||
}
|
||||
return resultSet.filter(makeBooleanFilter(filter));
|
||||
}
|
||||
},
|
||||
);
|
||||
this.post('/managed-groups');
|
||||
this.get('/managed-groups/:id');
|
||||
@@ -665,7 +665,7 @@ function routes() {
|
||||
'/workers',
|
||||
({ workers }, { queryParams: { scope_id: scopeId } }) => {
|
||||
return workers.where({ scopeId });
|
||||
}
|
||||
},
|
||||
);
|
||||
this.get('/workers/:id');
|
||||
this.del('/workers/:id');
|
||||
@@ -689,7 +689,7 @@ function routes() {
|
||||
return storageBuckets.all();
|
||||
}
|
||||
return storageBuckets.where({ scopeId });
|
||||
}
|
||||
},
|
||||
);
|
||||
this.get('/storage-buckets/:id');
|
||||
this.del('/storage-buckets/:id');
|
||||
@@ -708,7 +708,7 @@ function routes() {
|
||||
delete attrs.secrets;
|
||||
|
||||
return storageBuckets.create(attrs);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
// session recordings
|
||||
@@ -716,13 +716,13 @@ function routes() {
|
||||
'/session-recordings',
|
||||
(
|
||||
{ sessionRecordings },
|
||||
{ queryParams: { scope_id: scopeId, recursive } }
|
||||
{ queryParams: { scope_id: scopeId, recursive } },
|
||||
) => {
|
||||
if (recursive && scopeId === 'global') {
|
||||
return sessionRecordings.all();
|
||||
}
|
||||
return sessionRecordings.where({ scopeId });
|
||||
}
|
||||
},
|
||||
);
|
||||
this.get(
|
||||
'/session-recordings/:idMethod',
|
||||
@@ -735,7 +735,7 @@ function routes() {
|
||||
} else {
|
||||
return sessionRecordings.find(id);
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
/* Uncomment the following line and the Response import above
|
||||
|
||||
@@ -54,7 +54,7 @@ export default factory.extend({
|
||||
return {
|
||||
disable_credential_rotation: faker.datatype.boolean(),
|
||||
region: `us-${faker.location.cardinalDirection()}-${faker.number.int(
|
||||
9
|
||||
9,
|
||||
)}`,
|
||||
};
|
||||
case 'azure':
|
||||
|
||||
@@ -61,7 +61,7 @@ export default factory.extend({
|
||||
type: 'org',
|
||||
scope: { id: record.id, type: record.type },
|
||||
},
|
||||
'withChildren'
|
||||
'withChildren',
|
||||
);
|
||||
}
|
||||
if (record.type === 'org') {
|
||||
|
||||
@@ -57,7 +57,8 @@ export default factory.extend({
|
||||
const session = pickRandomElement(server.schema.sessions.all().models);
|
||||
session.id = 'deleted_session';
|
||||
const target = pickRandomElement(
|
||||
server.schema.targets.where((target) => target.storage_bucket_id).models
|
||||
server.schema.targets.where((target) => target.storage_bucket_id)
|
||||
.models,
|
||||
);
|
||||
target.id = 'deleted_target';
|
||||
|
||||
@@ -77,7 +78,8 @@ export default factory.extend({
|
||||
const user = pickRandomElement(server.schema.users.all().models);
|
||||
const session = pickRandomElement(server.schema.sessions.all().models);
|
||||
const target = pickRandomElement(
|
||||
server.schema.targets.where((target) => target.storage_bucket_id).models
|
||||
server.schema.targets.where((target) => target.storage_bucket_id)
|
||||
.models,
|
||||
);
|
||||
|
||||
sessionRecording.update({
|
||||
|
||||
@@ -46,7 +46,7 @@ export default factory.extend({
|
||||
case TYPE_STORAGE_BUCKET_PLUGIN_AWS_S3:
|
||||
return {
|
||||
region: `us-${faker.location.cardinalDirection()}-${faker.number.int(
|
||||
9
|
||||
9,
|
||||
)}`,
|
||||
disable_credential_rotation: faker.datatype.boolean(),
|
||||
};
|
||||
|
||||
@@ -60,7 +60,7 @@ export default factory.extend({
|
||||
|
||||
randomlySelectedCredentialLibraries = server.schema.credentialLibraries
|
||||
.where(
|
||||
(credentialLibrary) => credentialLibrary.scopeId === target.scope.id
|
||||
(credentialLibrary) => credentialLibrary.scopeId === target.scope.id,
|
||||
)
|
||||
.models.filter(() => randomBoolean())
|
||||
.map((cred) => cred.id);
|
||||
|
||||
@@ -51,7 +51,7 @@ export default Factory.extend({
|
||||
certificates: [faker.string.alphanumeric(50)],
|
||||
client_certificate: faker.string.alphanumeric(50),
|
||||
client_certificate_key: `---Begin Certificate --- ${faker.string.alphanumeric(
|
||||
170
|
||||
170,
|
||||
)} ---End Certificate ---`,
|
||||
client_certificate_key_hmac: faker.string.alphanumeric(50),
|
||||
enable_groups: true,
|
||||
|
||||
@@ -22,6 +22,6 @@ export default Factory.extend({
|
||||
active_connection_count: () => faker.number.int(10),
|
||||
release_version: () =>
|
||||
`Boundary v${faker.number.int(11)}.${faker.number.int(
|
||||
50
|
||||
50,
|
||||
)}.${faker.number.int(12)}`,
|
||||
});
|
||||
@@ -39,7 +39,7 @@ export default function (prefix = '') {
|
||||
let result = '';
|
||||
for (let i = 0; i < 10; i++) {
|
||||
result = result.concat(
|
||||
characters[Math.floor(random() * characters.length)]
|
||||
characters[Math.floor(random() * characters.length)],
|
||||
);
|
||||
}
|
||||
return prefix.concat(result);
|
||||
|
||||
@@ -35,13 +35,13 @@ class ToggledCapabilities {
|
||||
// Find the value of a pair with key `authorized_actions`
|
||||
// Safe-ish when the item is not present
|
||||
#rawAuthorizedActions = (this.#queryPairs.find(
|
||||
(item) => item[0] === 'authorized_actions'
|
||||
(item) => item[0] === 'authorized_actions',
|
||||
) || [])[1];
|
||||
|
||||
// Safe-ish when the value is not present
|
||||
#authorizedActions =
|
||||
JSON.parse(
|
||||
decodeURIComponent(this.#rawAuthorizedActions || '') || 'null'
|
||||
decodeURIComponent(this.#rawAuthorizedActions || '') || 'null',
|
||||
) || {};
|
||||
|
||||
// =methods
|
||||
|
||||
@@ -56,7 +56,7 @@ const commandHandlers = {
|
||||
last_used_time: '',
|
||||
expiration_time: '',
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
@@ -82,7 +82,7 @@ const commandHandlers = {
|
||||
auth_url: 'https://www.duckduckgo.com',
|
||||
token_id: 'token_1234',
|
||||
},
|
||||
}
|
||||
},
|
||||
),
|
||||
token: (_, scopeAttrs) => {
|
||||
oidcAttemptCounter++;
|
||||
@@ -105,7 +105,7 @@ const commandHandlers = {
|
||||
last_used_time: '',
|
||||
expiration_time: '',
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
@@ -115,7 +115,7 @@ const commandHandlers = {
|
||||
// Handles all custom methods on /auth-methods/:id route
|
||||
export function authHandler({ scopes, authMethods }, request) {
|
||||
const [, id, method] = request.params.id_method.match(
|
||||
/(?<id>.[^:]*):(?<method>(.*))/
|
||||
/(?<id>.[^:]*):(?<method>(.*))/,
|
||||
);
|
||||
const authMethod = authMethods.find(id);
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ export function targetHandler({ targets }, { params: { idMethod } }) {
|
||||
if (selectedHostSourceIds) {
|
||||
const listOfHostSources = addToSourcesList(
|
||||
originHostSetIds,
|
||||
selectedHostSourceIds
|
||||
selectedHostSourceIds,
|
||||
);
|
||||
if (listOfHostSources?.length) {
|
||||
updatedAttrs.hostSetIds = listOfHostSources;
|
||||
@@ -52,7 +52,7 @@ export function targetHandler({ targets }, { params: { idMethod } }) {
|
||||
if (selectedHostSourceIds) {
|
||||
const removedHostSources = removeFromSourcesList(
|
||||
originHostSetIds,
|
||||
selectedHostSourceIds
|
||||
selectedHostSourceIds,
|
||||
);
|
||||
updatedAttrs.hostSetIds = removedHostSources;
|
||||
}
|
||||
@@ -62,7 +62,7 @@ export function targetHandler({ targets }, { params: { idMethod } }) {
|
||||
if (selectedBrokeredCredentials) {
|
||||
const listOfBrokeredCredentialSources = addToSourcesList(
|
||||
originalBrokeredCredentials,
|
||||
selectedBrokeredCredentials
|
||||
selectedBrokeredCredentials,
|
||||
);
|
||||
if (listOfBrokeredCredentialSources?.length) {
|
||||
updatedAttrs.brokeredCredentialSourceIds =
|
||||
@@ -73,7 +73,7 @@ export function targetHandler({ targets }, { params: { idMethod } }) {
|
||||
if (selectedInjectedCredentials) {
|
||||
const listOfInjectedCredentialSources = addToSourcesList(
|
||||
originalInjectedCredentials,
|
||||
selectedInjectedCredentials
|
||||
selectedInjectedCredentials,
|
||||
);
|
||||
if (listOfInjectedCredentialSources?.length) {
|
||||
updatedAttrs.injectedApplicationCredentialSourceIds =
|
||||
@@ -86,7 +86,7 @@ export function targetHandler({ targets }, { params: { idMethod } }) {
|
||||
if (selectedBrokeredCredentials) {
|
||||
const removedCredentialSources = removeFromSourcesList(
|
||||
originalBrokeredCredentials,
|
||||
selectedBrokeredCredentials
|
||||
selectedBrokeredCredentials,
|
||||
);
|
||||
updatedAttrs.brokeredCredentialSourceIds = removedCredentialSources;
|
||||
}
|
||||
@@ -94,7 +94,7 @@ export function targetHandler({ targets }, { params: { idMethod } }) {
|
||||
if (selectedInjectedCredentials) {
|
||||
const removedCredentialSources = removeFromSourcesList(
|
||||
originalInjectedCredentials,
|
||||
selectedInjectedCredentials
|
||||
selectedInjectedCredentials,
|
||||
);
|
||||
updatedAttrs.injectedApplicationCredentialSourceIds =
|
||||
removedCredentialSources;
|
||||
|
||||
@@ -21,7 +21,7 @@ export default function (server) {
|
||||
type: 'org',
|
||||
scope: { id: globalScope.id, type: globalScope.type },
|
||||
},
|
||||
'withChildren'
|
||||
'withChildren',
|
||||
)[0];
|
||||
|
||||
// Auth
|
||||
@@ -29,13 +29,13 @@ export default function (server) {
|
||||
'auth-method',
|
||||
5,
|
||||
{ scope: globalScope },
|
||||
'withAccountsAndUsersAndManagedGroups'
|
||||
'withAccountsAndUsersAndManagedGroups',
|
||||
);
|
||||
const orgAuthMethods = server.createList(
|
||||
'auth-method',
|
||||
3,
|
||||
{ scope: orgScope },
|
||||
'withAccountsAndUsersAndManagedGroups'
|
||||
'withAccountsAndUsersAndManagedGroups',
|
||||
);
|
||||
// Authenticated user/account
|
||||
const user = server.create('user', {
|
||||
@@ -62,13 +62,13 @@ export default function (server) {
|
||||
'role',
|
||||
1,
|
||||
{ scope: globalScope },
|
||||
'withPrincipals'
|
||||
'withPrincipals',
|
||||
);
|
||||
//create managed groups for role/principals in globalScope
|
||||
globalScopeRoles.forEach((role) => {
|
||||
const { scope } = role;
|
||||
const oidcAuthMethod = globalAuthMethods.filter(
|
||||
(auth) => auth.type === TYPE_AUTH_METHOD_OIDC
|
||||
(auth) => auth.type === TYPE_AUTH_METHOD_OIDC,
|
||||
)[0];
|
||||
const { type } = oidcAuthMethod;
|
||||
const managedGroups = server.createList('managed-group', 2, {
|
||||
@@ -83,13 +83,13 @@ export default function (server) {
|
||||
'role',
|
||||
5,
|
||||
{ scope: orgScope },
|
||||
'withPrincipals'
|
||||
'withPrincipals',
|
||||
);
|
||||
//create managed groups for role/principals in orgScope
|
||||
orgScopeRoles.forEach((role) => {
|
||||
const { scope } = role;
|
||||
const oidcAuthMethod = orgAuthMethods.filter(
|
||||
(auth) => auth.type === TYPE_AUTH_METHOD_OIDC
|
||||
(auth) => auth.type === TYPE_AUTH_METHOD_OIDC,
|
||||
)[0];
|
||||
const { type } = oidcAuthMethod;
|
||||
const managedGroups = server.createList('managed-group', 2, {
|
||||
@@ -129,19 +129,19 @@ export default function (server) {
|
||||
3,
|
||||
{ scope: globalScope },
|
||||
'withConnectionAndChannels',
|
||||
'withExistingUserAndTarget'
|
||||
'withExistingUserAndTarget',
|
||||
);
|
||||
server.create(
|
||||
'session-recording',
|
||||
{ scope: globalScope },
|
||||
'withConnectionAndChannels',
|
||||
'withNonExistingUserAndTarget'
|
||||
'withNonExistingUserAndTarget',
|
||||
);
|
||||
server.createList(
|
||||
'session-recording',
|
||||
2,
|
||||
{ scope: orgScope },
|
||||
'withConnectionAndChannels',
|
||||
'withExistingUserAndTarget'
|
||||
'withExistingUserAndTarget',
|
||||
);
|
||||
}
|
||||
@@ -11,7 +11,7 @@ export default ApplicationSerializer.extend({
|
||||
_hashForModel(model) {
|
||||
const json = ApplicationSerializer.prototype._hashForModel.apply(
|
||||
this,
|
||||
arguments
|
||||
arguments,
|
||||
);
|
||||
json.auth_method_id = model.authMethodId;
|
||||
delete json.attributes?.password;
|
||||
|
||||
@@ -38,7 +38,7 @@ export default RestSerializer.extend({
|
||||
|
||||
keyForRelationshipId(relationshipName) {
|
||||
return `${this._container.inflector.singularize(
|
||||
underscore(relationshipName)
|
||||
underscore(relationshipName),
|
||||
)}_id`;
|
||||
},
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ export default ApplicationSerializer.extend({
|
||||
_hashForModel(model) {
|
||||
const json = ApplicationSerializer.prototype._hashForModel.apply(
|
||||
this,
|
||||
arguments
|
||||
arguments,
|
||||
);
|
||||
// If the scope marks this auth method as primary, designate it
|
||||
// as such with a read-only boolean field (this is how the API behaves).
|
||||
|
||||
@@ -11,7 +11,7 @@ export default ApplicationSerializer.extend({
|
||||
_hashForModel(model) {
|
||||
const json = ApplicationSerializer.prototype._hashForModel.apply(
|
||||
this,
|
||||
arguments
|
||||
arguments,
|
||||
);
|
||||
const { channelRecordings } = this.schema;
|
||||
if (model.channelRecordingIds) {
|
||||
|
||||
@@ -11,7 +11,7 @@ export default ApplicationSerializer.extend({
|
||||
_hashForModel(model) {
|
||||
const json = ApplicationSerializer.prototype._hashForModel.apply(
|
||||
this,
|
||||
arguments
|
||||
arguments,
|
||||
);
|
||||
json.credential_store_id = model.credentialStoreId;
|
||||
return json;
|
||||
|
||||
@@ -11,7 +11,7 @@ export default ApplicationSerializer.extend({
|
||||
_hashForModel(/* model */) {
|
||||
const json = ApplicationSerializer.prototype._hashForModel.apply(
|
||||
this,
|
||||
arguments
|
||||
arguments,
|
||||
);
|
||||
// in a real API, the following fields are set-only and returned in
|
||||
// associated HMAC fields
|
||||
|
||||
@@ -11,7 +11,7 @@ export default ApplicationSerializer.extend({
|
||||
_hashForModel(model) {
|
||||
const json = ApplicationSerializer.prototype._hashForModel.apply(
|
||||
this,
|
||||
arguments
|
||||
arguments,
|
||||
);
|
||||
json.credential_store_id = model.credentialStoreId;
|
||||
|
||||
|
||||
@@ -11,14 +11,14 @@ export default ApplicationSerializer.extend({
|
||||
|
||||
keyForRelationshipIds(relationshipName) {
|
||||
return `${this._container.inflector.singularize(
|
||||
underscore(relationshipName)
|
||||
underscore(relationshipName),
|
||||
)}_ids`;
|
||||
},
|
||||
|
||||
_hashForModel(model) {
|
||||
const json = ApplicationSerializer.prototype._hashForModel.apply(
|
||||
this,
|
||||
arguments
|
||||
arguments,
|
||||
);
|
||||
if (model.memberIds.length) json.member_ids = model.memberIds;
|
||||
return json;
|
||||
|
||||
@@ -11,14 +11,14 @@ export default ApplicationSerializer.extend({
|
||||
|
||||
keyForRelationshipIds(relationshipName) {
|
||||
return `${this._container.inflector.singularize(
|
||||
underscore(relationshipName)
|
||||
underscore(relationshipName),
|
||||
)}_ids`;
|
||||
},
|
||||
|
||||
_hashForModel(model) {
|
||||
const json = ApplicationSerializer.prototype._hashForModel.apply(
|
||||
this,
|
||||
arguments
|
||||
arguments,
|
||||
);
|
||||
json.host_catalog_id = model.hostCatalogId;
|
||||
if (model.hostIds?.length) {
|
||||
|
||||
@@ -11,7 +11,7 @@ export default ApplicationSerializer.extend({
|
||||
_hashForModel(model) {
|
||||
const json = ApplicationSerializer.prototype._hashForModel.apply(
|
||||
this,
|
||||
arguments
|
||||
arguments,
|
||||
);
|
||||
json.host_catalog_id = model.hostCatalogId;
|
||||
return json;
|
||||
|
||||
@@ -11,7 +11,7 @@ export default ApplicationSerializer.extend({
|
||||
_hashForModel(model) {
|
||||
const json = ApplicationSerializer.prototype._hashForModel.apply(
|
||||
this,
|
||||
arguments
|
||||
arguments,
|
||||
);
|
||||
json.auth_method_id = model.authMethodId;
|
||||
return json;
|
||||
|
||||
@@ -11,7 +11,7 @@ export default ApplicationSerializer.extend({
|
||||
_hashForModel(model) {
|
||||
const json = ApplicationSerializer.prototype._hashForModel.apply(
|
||||
this,
|
||||
arguments
|
||||
arguments,
|
||||
);
|
||||
const serializedUsers = model.users.models.map((user) => ({
|
||||
scope_id: model.scope.id,
|
||||
@@ -28,7 +28,7 @@ export default ApplicationSerializer.extend({
|
||||
scope_id: model.scope.id,
|
||||
id: managedGroup.id,
|
||||
type: 'managed group',
|
||||
})
|
||||
}),
|
||||
);
|
||||
json.principals = [
|
||||
...serializedUsers,
|
||||
|
||||
@@ -12,7 +12,7 @@ export default ApplicationSerializer.extend({
|
||||
_hashForModel(model) {
|
||||
const json = ApplicationSerializer.prototype._hashForModel.apply(
|
||||
this,
|
||||
arguments
|
||||
arguments,
|
||||
);
|
||||
const { connectionRecordings, scopes } = this.schema;
|
||||
|
||||
@@ -22,7 +22,7 @@ export default ApplicationSerializer.extend({
|
||||
const connection = connectionRecordings.find(id);
|
||||
return ConnectionRecordingSerializer.prototype._hashForModel.apply(
|
||||
this,
|
||||
[connection]
|
||||
[connection],
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -11,14 +11,14 @@ export default ApplicationSerializer.extend({
|
||||
|
||||
keyForRelationshipId(relationshipName) {
|
||||
return `${this._container.inflector.singularize(
|
||||
underscore(relationshipName)
|
||||
underscore(relationshipName),
|
||||
)}_id`;
|
||||
},
|
||||
|
||||
_hashForModel(model) {
|
||||
const json = ApplicationSerializer.prototype._hashForModel.apply(
|
||||
this,
|
||||
arguments
|
||||
arguments,
|
||||
);
|
||||
json.user_id = model.userId;
|
||||
json.target_id = model.targetId;
|
||||
|
||||
@@ -11,14 +11,14 @@ export default ApplicationSerializer.extend({
|
||||
|
||||
keyForRelationshipIds(relationshipName) {
|
||||
return `${this._container.inflector.singularize(
|
||||
underscore(relationshipName)
|
||||
underscore(relationshipName),
|
||||
)}_ids`;
|
||||
},
|
||||
|
||||
_hashForModel(model) {
|
||||
const json = ApplicationSerializer.prototype._hashForModel.apply(
|
||||
this,
|
||||
arguments
|
||||
arguments,
|
||||
);
|
||||
const { hostSets } = this.schema;
|
||||
if (model.hostSetIds?.length) {
|
||||
|
||||
@@ -11,14 +11,14 @@ export default ApplicationSerializer.extend({
|
||||
|
||||
keyForRelationshipIds(relationshipName) {
|
||||
return `${this._container.inflector.singularize(
|
||||
underscore(relationshipName)
|
||||
underscore(relationshipName),
|
||||
)}_ids`;
|
||||
},
|
||||
|
||||
_hashForModel(model) {
|
||||
const json = ApplicationSerializer.prototype._hashForModel.apply(
|
||||
this,
|
||||
arguments
|
||||
arguments,
|
||||
);
|
||||
if (model.accountIds.length) json.account_ids = model.accountIds;
|
||||
return json;
|
||||
|
||||
@@ -35,7 +35,7 @@ module('Unit | Ability | channel-recording', function (hooks) {
|
||||
'connection-recording',
|
||||
{
|
||||
session_recording: sessionRecordingModel,
|
||||
}
|
||||
},
|
||||
);
|
||||
const channelRecordingModel = store.createRecord('channel-recording', {
|
||||
mime_types: [MIME_TYPE_ASCIICAST],
|
||||
@@ -43,7 +43,7 @@ module('Unit | Ability | channel-recording', function (hooks) {
|
||||
});
|
||||
|
||||
assert.true(
|
||||
canService.can('getAsciicast channel-recording', channelRecordingModel)
|
||||
canService.can('getAsciicast channel-recording', channelRecordingModel),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -58,7 +58,7 @@ module('Unit | Ability | channel-recording', function (hooks) {
|
||||
'connection-recording',
|
||||
{
|
||||
session_recording: sessionRecordingModel,
|
||||
}
|
||||
},
|
||||
);
|
||||
const channelRecordingModel = store.createRecord('channel-recording', {
|
||||
mime_types: ['unknown'],
|
||||
@@ -66,7 +66,7 @@ module('Unit | Ability | channel-recording', function (hooks) {
|
||||
});
|
||||
|
||||
assert.false(
|
||||
canService.can('getAsciicast channel-recording', channelRecordingModel)
|
||||
canService.can('getAsciicast channel-recording', channelRecordingModel),
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -29,26 +29,26 @@ module('Unit | Ability | session-recording', function (hooks) {
|
||||
'session-recording',
|
||||
{
|
||||
authorized_actions: ['download'],
|
||||
}
|
||||
},
|
||||
);
|
||||
const recordingWithoutAuthorizedAction = store.createRecord(
|
||||
'session-recording',
|
||||
{
|
||||
authorized_actions: [],
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
assert.true(
|
||||
canService.can(
|
||||
'download session-recording',
|
||||
recordingWithAuthorizedAction
|
||||
)
|
||||
recordingWithAuthorizedAction,
|
||||
),
|
||||
);
|
||||
assert.false(
|
||||
canService.can(
|
||||
'download session-recording',
|
||||
recordingWithoutAuthorizedAction
|
||||
)
|
||||
recordingWithoutAuthorizedAction,
|
||||
),
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -80,19 +80,19 @@ module('Unit | Abilities | Target', function (hooks) {
|
||||
};
|
||||
|
||||
assert.true(
|
||||
canService.can('addInjectedApplicationCredentialSources target', model)
|
||||
canService.can('addInjectedApplicationCredentialSources target', model),
|
||||
);
|
||||
assert.false(
|
||||
canService.can(
|
||||
'addInjectedApplicationCredentialSources target',
|
||||
modelWithoutAuthorizedActions
|
||||
)
|
||||
modelWithoutAuthorizedActions,
|
||||
),
|
||||
);
|
||||
assert.false(
|
||||
canService.can(
|
||||
'addInjectedApplicationCredentialSources target',
|
||||
modelWithoutSSHType
|
||||
)
|
||||
modelWithoutSSHType,
|
||||
),
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -37,25 +37,25 @@ module('Unit | Abilities | User', function (hooks) {
|
||||
assert.true(
|
||||
canService.can('addAccount user', instances.user, {
|
||||
account: instances.account,
|
||||
})
|
||||
}),
|
||||
);
|
||||
instances.account.type = TYPE_AUTH_METHOD_PASSWORD;
|
||||
assert.true(
|
||||
canService.can('addAccount user', instances.user, {
|
||||
account: instances.account,
|
||||
})
|
||||
}),
|
||||
);
|
||||
instances.account.type = TYPE_AUTH_METHOD_LDAP;
|
||||
assert.true(
|
||||
canService.can('addAccount user', instances.user, {
|
||||
account: instances.account,
|
||||
})
|
||||
}),
|
||||
);
|
||||
instances.account.type = 'no-such-type';
|
||||
assert.false(
|
||||
canService.can('addAccount user', instances.user, {
|
||||
account: instances.account,
|
||||
})
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -67,25 +67,25 @@ module('Unit | Abilities | User', function (hooks) {
|
||||
assert.false(
|
||||
canService.can('addAccount user', instances.user, {
|
||||
account: instances.account,
|
||||
})
|
||||
}),
|
||||
);
|
||||
instances.account.type = TYPE_AUTH_METHOD_PASSWORD;
|
||||
assert.false(
|
||||
canService.can('addAccount user', instances.user, {
|
||||
account: instances.account,
|
||||
})
|
||||
}),
|
||||
);
|
||||
instances.account.type = TYPE_AUTH_METHOD_LDAP;
|
||||
assert.false(
|
||||
canService.can('addAccount user', instances.user, {
|
||||
account: instances.account,
|
||||
})
|
||||
}),
|
||||
);
|
||||
instances.account.type = 'no-such-type';
|
||||
assert.false(
|
||||
canService.can('addAccount user', instances.user, {
|
||||
account: instances.account,
|
||||
})
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -97,25 +97,25 @@ module('Unit | Abilities | User', function (hooks) {
|
||||
assert.true(
|
||||
canService.can('removeAccount user', instances.user, {
|
||||
account: instances.account,
|
||||
})
|
||||
}),
|
||||
);
|
||||
instances.account.type = TYPE_AUTH_METHOD_PASSWORD;
|
||||
assert.true(
|
||||
canService.can('removeAccount user', instances.user, {
|
||||
account: instances.account,
|
||||
})
|
||||
}),
|
||||
);
|
||||
instances.account.type = TYPE_AUTH_METHOD_LDAP;
|
||||
assert.true(
|
||||
canService.can('removeAccount user', instances.user, {
|
||||
account: instances.account,
|
||||
})
|
||||
}),
|
||||
);
|
||||
instances.account.type = 'no-such-type';
|
||||
assert.false(
|
||||
canService.can('removeAccount user', instances.user, {
|
||||
account: instances.account,
|
||||
})
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -127,25 +127,25 @@ module('Unit | Abilities | User', function (hooks) {
|
||||
assert.false(
|
||||
canService.can('addAccount user', instances.user, {
|
||||
account: instances.account,
|
||||
})
|
||||
}),
|
||||
);
|
||||
instances.account.type = TYPE_AUTH_METHOD_PASSWORD;
|
||||
assert.false(
|
||||
canService.can('removeAccount user', instances.user, {
|
||||
account: instances.account,
|
||||
})
|
||||
}),
|
||||
);
|
||||
instances.account.type = TYPE_AUTH_METHOD_LDAP;
|
||||
assert.false(
|
||||
canService.can('removeAccount user', instances.user, {
|
||||
account: instances.account,
|
||||
})
|
||||
}),
|
||||
);
|
||||
instances.account.type = 'no-such-type';
|
||||
assert.false(
|
||||
canService.can('removeAccount user', instances.user, {
|
||||
account: instances.account,
|
||||
})
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -67,7 +67,7 @@ module('Unit | Adapter | application', function (hooks) {
|
||||
'user',
|
||||
'1',
|
||||
mockSnapshot,
|
||||
'findRecord'
|
||||
'findRecord',
|
||||
);
|
||||
assert.strictEqual(findRecordURL, '/v1/users/1:my-custom-method');
|
||||
const findAllURL = adapter.buildURL('user', null, mockSnapshot, 'findAll');
|
||||
@@ -76,28 +76,28 @@ module('Unit | Adapter | application', function (hooks) {
|
||||
'user',
|
||||
'2',
|
||||
mockSnapshot,
|
||||
'findBelongsTo'
|
||||
'findBelongsTo',
|
||||
);
|
||||
assert.strictEqual(findBelongsToURL, '/v1/users/2:my-custom-method');
|
||||
const createRecordURL = adapter.buildURL(
|
||||
'user',
|
||||
null,
|
||||
mockSnapshot,
|
||||
'createRecord'
|
||||
'createRecord',
|
||||
);
|
||||
assert.strictEqual(createRecordURL, '/v1/users:my-custom-method');
|
||||
const updateRecordURL = adapter.buildURL(
|
||||
'user',
|
||||
'3',
|
||||
mockSnapshot,
|
||||
'updateRecord'
|
||||
'updateRecord',
|
||||
);
|
||||
assert.strictEqual(updateRecordURL, '/v1/users/3:my-custom-method');
|
||||
const deleteRecordURL = adapter.buildURL(
|
||||
'user',
|
||||
'4',
|
||||
mockSnapshot,
|
||||
'deleteRecord'
|
||||
'deleteRecord',
|
||||
);
|
||||
assert.strictEqual(deleteRecordURL, '/v1/users/4:my-custom-method');
|
||||
});
|
||||
@@ -109,7 +109,7 @@ module('Unit | Adapter | application', function (hooks) {
|
||||
assert.strictEqual(
|
||||
scope_id,
|
||||
'p_456',
|
||||
'Scoped resource URL was requested.'
|
||||
'Scoped resource URL was requested.',
|
||||
);
|
||||
return { items: [] };
|
||||
});
|
||||
@@ -154,7 +154,7 @@ module('Unit | Adapter | application', function (hooks) {
|
||||
store,
|
||||
{ modelName: 'user' },
|
||||
null,
|
||||
[]
|
||||
[],
|
||||
);
|
||||
assert.deepEqual(prenormalized, { items: [] });
|
||||
});
|
||||
@@ -209,7 +209,7 @@ module('Unit | Adapter | application', function (hooks) {
|
||||
assert.strictEqual(
|
||||
handledResponse.errors.length,
|
||||
2,
|
||||
'A base error plus one field error'
|
||||
'A base error plus one field error',
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -25,7 +25,7 @@ module('Unit | Adapter | host catalog', function (hooks) {
|
||||
'host-catalog',
|
||||
null,
|
||||
mockSnapshot,
|
||||
'createRecord'
|
||||
'createRecord',
|
||||
);
|
||||
assert.strictEqual(createRecordURL, '/v1/host-catalogs');
|
||||
});
|
||||
@@ -46,7 +46,7 @@ module('Unit | Adapter | host catalog', function (hooks) {
|
||||
'host-catalog',
|
||||
null,
|
||||
mockSnapshot,
|
||||
'createRecord'
|
||||
'createRecord',
|
||||
);
|
||||
assert.strictEqual(createRecordURL, '/v1/host-catalogs?plugin_name=aws');
|
||||
});
|
||||
|
||||
@@ -25,11 +25,11 @@ module('Unit | Adapter | session recording', function (hooks) {
|
||||
'sr_id',
|
||||
mockSnapshot,
|
||||
'findRecord',
|
||||
queryObject
|
||||
queryObject,
|
||||
);
|
||||
assert.strictEqual(
|
||||
createRecordURL,
|
||||
'/v1/session-recordings/sr_id:download?mime_type=mimeType'
|
||||
'/v1/session-recordings/sr_id:download?mime_type=mimeType',
|
||||
);
|
||||
});
|
||||
|
||||
@@ -40,7 +40,7 @@ module('Unit | Adapter | session recording', function (hooks) {
|
||||
'session-recording',
|
||||
'sr_id',
|
||||
{},
|
||||
'findRecord'
|
||||
'findRecord',
|
||||
);
|
||||
assert.strictEqual(createRecordURL, '/v1/session-recordings/sr_id');
|
||||
});
|
||||
|
||||
@@ -25,11 +25,11 @@ module('Unit | Adapter | storage bucket', function (hooks) {
|
||||
'storage-bucket',
|
||||
null,
|
||||
mockSnapshot,
|
||||
'createRecord'
|
||||
'createRecord',
|
||||
);
|
||||
assert.strictEqual(
|
||||
createRecordURL,
|
||||
'/v1/storage-buckets?plugin_name=aws_s3'
|
||||
'/v1/storage-buckets?plugin_name=aws_s3',
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -40,7 +40,7 @@ module('Unit | Model | auth method', function (hooks) {
|
||||
version: 1,
|
||||
});
|
||||
return { id: '123abc' };
|
||||
}
|
||||
},
|
||||
);
|
||||
store.push({
|
||||
data: {
|
||||
|
||||
@@ -27,12 +27,12 @@ module('Unit | Model | group', function (hooks) {
|
||||
assert.strictEqual(
|
||||
group.member_ids.length,
|
||||
2,
|
||||
'Group has two entires in member_ids'
|
||||
'Group has two entires in member_ids',
|
||||
);
|
||||
assert.strictEqual(
|
||||
group.members.length,
|
||||
0,
|
||||
'Group has no resolved members because they are not loaded yet'
|
||||
'Group has no resolved members because they are not loaded yet',
|
||||
);
|
||||
store.push({
|
||||
data: {
|
||||
@@ -53,12 +53,12 @@ module('Unit | Model | group', function (hooks) {
|
||||
assert.strictEqual(
|
||||
group.member_ids.length,
|
||||
2,
|
||||
'Group has two entires in member_ids'
|
||||
'Group has two entires in member_ids',
|
||||
);
|
||||
assert.strictEqual(
|
||||
group.members.length,
|
||||
2,
|
||||
'Group has two resolved members'
|
||||
'Group has two resolved members',
|
||||
);
|
||||
});
|
||||
|
||||
@@ -168,7 +168,7 @@ module('Unit | Model | group', function (hooks) {
|
||||
assert.strictEqual(
|
||||
group.member_ids.length,
|
||||
0,
|
||||
'Group has empty member_ids by default'
|
||||
'Group has empty member_ids by default',
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -94,7 +94,7 @@ module('Unit | Model | role', function (hooks) {
|
||||
version: 1,
|
||||
});
|
||||
return { id: '123abc' };
|
||||
}
|
||||
},
|
||||
);
|
||||
const store = this.owner.lookup('service:store');
|
||||
store.push({
|
||||
@@ -132,7 +132,7 @@ module('Unit | Model | role', function (hooks) {
|
||||
version: 1,
|
||||
});
|
||||
return { id: '123abc' };
|
||||
}
|
||||
},
|
||||
);
|
||||
const store = this.owner.lookup('service:store');
|
||||
store.push({
|
||||
|
||||
@@ -30,27 +30,27 @@ module('Unit | Model | scope', function (hooks) {
|
||||
assert.strictEqual(
|
||||
await scopes.objectAt(1).get('scope.scope_id'),
|
||||
'global',
|
||||
'Org 1 parent scope is global'
|
||||
'Org 1 parent scope is global',
|
||||
);
|
||||
assert.strictEqual(
|
||||
await scopes.objectAt(2).get('scope.scope_id'),
|
||||
'global',
|
||||
'Org 2 parent scope is global'
|
||||
'Org 2 parent scope is global',
|
||||
);
|
||||
assert.strictEqual(
|
||||
await scopes.objectAt(3).get('scope.scope_id'),
|
||||
'o_1',
|
||||
'Project 1 parent scope is org 1'
|
||||
'Project 1 parent scope is org 1',
|
||||
);
|
||||
assert.strictEqual(
|
||||
await scopes.objectAt(4).get('scope.scope_id'),
|
||||
'o_1',
|
||||
'Project 2 parent scope is org 1'
|
||||
'Project 2 parent scope is org 1',
|
||||
);
|
||||
assert.strictEqual(
|
||||
await scopes.objectAt(5).get('scope.scope_id'),
|
||||
'o_2',
|
||||
'Project 3 parent scope is org 2'
|
||||
'Project 3 parent scope is org 2',
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ module('Unit | Model | storage bucket', function (hooks) {
|
||||
assert.strictEqual(modelPlugin.type, 'plugin');
|
||||
assert.strictEqual(
|
||||
modelPlugin.plugin.name,
|
||||
TYPE_STORAGE_BUCKET_PLUGIN_AWS_S3
|
||||
TYPE_STORAGE_BUCKET_PLUGIN_AWS_S3,
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -31,12 +31,12 @@ module('Unit | Model | target', function (hooks) {
|
||||
assert.strictEqual(
|
||||
target.host_sources.length,
|
||||
2,
|
||||
'Target has two entires in host_sources'
|
||||
'Target has two entires in host_sources',
|
||||
);
|
||||
assert.strictEqual(
|
||||
target.hostSets.length,
|
||||
0,
|
||||
'Target has no resolved hostSets because they are not loaded yet'
|
||||
'Target has no resolved hostSets because they are not loaded yet',
|
||||
);
|
||||
store.push({
|
||||
data: {
|
||||
@@ -55,16 +55,16 @@ module('Unit | Model | target', function (hooks) {
|
||||
assert.strictEqual(
|
||||
target.host_sources.length,
|
||||
2,
|
||||
'Target has two entires in host_sources'
|
||||
'Target has two entires in host_sources',
|
||||
);
|
||||
assert.strictEqual(
|
||||
target.hostSets.length,
|
||||
2,
|
||||
'Target has two resolved hostSets'
|
||||
'Target has two resolved hostSets',
|
||||
);
|
||||
assert.notOk(
|
||||
target.hostSets[0].hostCatalog,
|
||||
'Host catalog was not resolved because it is not loaded yet'
|
||||
'Host catalog was not resolved because it is not loaded yet',
|
||||
);
|
||||
store.push({
|
||||
data: {
|
||||
@@ -89,7 +89,7 @@ module('Unit | Model | target', function (hooks) {
|
||||
version: 1,
|
||||
});
|
||||
return { id: '123abc' };
|
||||
}
|
||||
},
|
||||
);
|
||||
const store = this.owner.lookup('service:store');
|
||||
store.push({
|
||||
@@ -126,7 +126,7 @@ module('Unit | Model | target', function (hooks) {
|
||||
version: 1,
|
||||
});
|
||||
return { id: '123abc' };
|
||||
}
|
||||
},
|
||||
);
|
||||
const store = this.owner.lookup('service:store');
|
||||
store.push({
|
||||
@@ -163,7 +163,7 @@ module('Unit | Model | target', function (hooks) {
|
||||
version: 1,
|
||||
});
|
||||
return { id: '123abc' };
|
||||
}
|
||||
},
|
||||
);
|
||||
const store = this.owner.lookup('service:store');
|
||||
store.push({
|
||||
@@ -224,12 +224,12 @@ module('Unit | Model | target', function (hooks) {
|
||||
assert.strictEqual(
|
||||
store.peekAll('session').length,
|
||||
3,
|
||||
'There are 3 sessions loaded in the store'
|
||||
'There are 3 sessions loaded in the store',
|
||||
);
|
||||
assert.strictEqual(
|
||||
target.sessions.length,
|
||||
2,
|
||||
'Target has two associated sessions loaded in the store'
|
||||
'Target has two associated sessions loaded in the store',
|
||||
);
|
||||
});
|
||||
|
||||
@@ -249,12 +249,12 @@ module('Unit | Model | target', function (hooks) {
|
||||
assert.strictEqual(
|
||||
target.brokered_credential_source_ids.length,
|
||||
2,
|
||||
'Target has two entires in brokered_credential_source_ids'
|
||||
'Target has two entires in brokered_credential_source_ids',
|
||||
);
|
||||
assert.strictEqual(
|
||||
target.brokeredCredentialSources.length,
|
||||
0,
|
||||
'Target has no resolved credentialSources, because they are not yet loaded'
|
||||
'Target has no resolved credentialSources, because they are not yet loaded',
|
||||
);
|
||||
store.push({
|
||||
data: {
|
||||
@@ -274,12 +274,12 @@ module('Unit | Model | target', function (hooks) {
|
||||
assert.strictEqual(
|
||||
target.brokered_credential_source_ids.length,
|
||||
2,
|
||||
'Target has two entires in brokered_credential_source_ids'
|
||||
'Target has two entires in brokered_credential_source_ids',
|
||||
);
|
||||
assert.strictEqual(
|
||||
target.brokeredCredentialSources.length,
|
||||
2,
|
||||
'Target has two resolved credentialSources'
|
||||
'Target has two resolved credentialSources',
|
||||
);
|
||||
});
|
||||
|
||||
@@ -294,7 +294,7 @@ module('Unit | Model | target', function (hooks) {
|
||||
version: 1,
|
||||
});
|
||||
return { id: '123abc' };
|
||||
}
|
||||
},
|
||||
);
|
||||
const store = this.owner.lookup('service:store');
|
||||
store.push({
|
||||
@@ -328,7 +328,7 @@ module('Unit | Model | target', function (hooks) {
|
||||
version: 1,
|
||||
});
|
||||
return { id: '123abc' };
|
||||
}
|
||||
},
|
||||
);
|
||||
const store = this.owner.lookup('service:store');
|
||||
store.push({
|
||||
@@ -362,7 +362,7 @@ module('Unit | Model | target', function (hooks) {
|
||||
version: 1,
|
||||
});
|
||||
return { id: '123abc' };
|
||||
}
|
||||
},
|
||||
);
|
||||
const store = this.owner.lookup('service:store');
|
||||
store.push({
|
||||
|
||||
@@ -117,7 +117,7 @@ module('Unit | Model | user', function (hooks) {
|
||||
assert.strictEqual(
|
||||
user.account_ids.length,
|
||||
0,
|
||||
'User has empty account_ids by default'
|
||||
'User has empty account_ids by default',
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -205,7 +205,7 @@ module('Unit | Serializer | application', function (hooks) {
|
||||
const normalizedArray = serializer.normalizeArrayResponse(
|
||||
store,
|
||||
userModelClass,
|
||||
payload
|
||||
payload,
|
||||
);
|
||||
assert.deepEqual(normalizedArray, {
|
||||
included: [],
|
||||
@@ -254,7 +254,7 @@ module('Unit | Serializer | application', function (hooks) {
|
||||
const normalized = serializer.normalizeSingleResponse(
|
||||
store,
|
||||
userModelClass,
|
||||
payload
|
||||
payload,
|
||||
);
|
||||
assert.deepEqual(normalized, {
|
||||
included: [],
|
||||
@@ -285,7 +285,7 @@ module('Unit | Serializer | application', function (hooks) {
|
||||
const normalized = serializer.normalizeSingleResponse(
|
||||
store,
|
||||
target,
|
||||
payload
|
||||
payload,
|
||||
);
|
||||
assert.deepEqual(normalized, {
|
||||
included: [],
|
||||
@@ -318,7 +318,7 @@ module('Unit | Serializer | application', function (hooks) {
|
||||
const normalized = serializer.normalizeUpdateRecordResponse(
|
||||
store,
|
||||
user,
|
||||
payload
|
||||
payload,
|
||||
);
|
||||
assert.deepEqual(normalized, {
|
||||
included: [],
|
||||
|
||||
@@ -36,7 +36,7 @@ module('Unit | Serializer | auth method', function (hooks) {
|
||||
assert.ok(serializedRecord);
|
||||
assert.notOk(
|
||||
serializedRecord.attributes,
|
||||
'Password should not have attributes'
|
||||
'Password should not have attributes',
|
||||
);
|
||||
});
|
||||
|
||||
@@ -327,7 +327,7 @@ module('Unit | Serializer | auth method', function (hooks) {
|
||||
const normalizedArray = serializer.normalizeArrayResponse(
|
||||
store,
|
||||
modelClass,
|
||||
payload
|
||||
payload,
|
||||
);
|
||||
assert.ok(payload.items[1].is_primary, 'Second payload item is primary');
|
||||
assert.deepEqual(
|
||||
@@ -370,7 +370,7 @@ module('Unit | Serializer | auth method', function (hooks) {
|
||||
},
|
||||
],
|
||||
},
|
||||
'First normalized item is primary'
|
||||
'First normalized item is primary',
|
||||
);
|
||||
});
|
||||
|
||||
@@ -432,7 +432,7 @@ module('Unit | Serializer | auth method', function (hooks) {
|
||||
assert.strictEqual(record.client_id, clientId);
|
||||
assert.strictEqual(
|
||||
record.disable_discovered_config_validation,
|
||||
disableDiscoveredConfigValidation
|
||||
disableDiscoveredConfigValidation,
|
||||
);
|
||||
assert.strictEqual(record.dry_run, dryRun);
|
||||
assert.strictEqual(record.issuer, issuer);
|
||||
|
||||
@@ -143,7 +143,7 @@ module('Unit | Serializer | credential library', function (hooks) {
|
||||
name: null,
|
||||
type: TYPE_CREDENTIAL_LIBRARY_VAULT_GENERIC,
|
||||
},
|
||||
'http_request_body attribute is not expected'
|
||||
'http_request_body attribute is not expected',
|
||||
);
|
||||
|
||||
record.http_method = 'POST';
|
||||
@@ -161,7 +161,7 @@ module('Unit | Serializer | credential library', function (hooks) {
|
||||
name: null,
|
||||
type: TYPE_CREDENTIAL_LIBRARY_VAULT_GENERIC,
|
||||
},
|
||||
'http_request_body attribute is expected'
|
||||
'http_request_body attribute is expected',
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@ module('Unit | Serializer | credential store', function (hooks) {
|
||||
name: null,
|
||||
type: 'vault',
|
||||
},
|
||||
'token attribute is not expected'
|
||||
'token attribute is not expected',
|
||||
);
|
||||
});
|
||||
|
||||
@@ -198,7 +198,7 @@ module('Unit | Serializer | credential store', function (hooks) {
|
||||
name: null,
|
||||
type: 'vault',
|
||||
},
|
||||
'client certificate key attribute is not expected'
|
||||
'client certificate key attribute is not expected',
|
||||
);
|
||||
|
||||
record.client_certificate_key = 'client-cert-key-456';
|
||||
@@ -221,7 +221,7 @@ module('Unit | Serializer | credential store', function (hooks) {
|
||||
name: null,
|
||||
type: 'vault',
|
||||
},
|
||||
'client certificate key attribute is expected'
|
||||
'client certificate key attribute is expected',
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ module('Unit | Serializer | group', function (hooks) {
|
||||
const normalized = serializer.normalizeSingleResponse(
|
||||
store,
|
||||
group,
|
||||
payload
|
||||
payload,
|
||||
);
|
||||
assert.deepEqual(normalized, {
|
||||
included: [],
|
||||
|
||||
@@ -184,7 +184,7 @@ module('Unit | Serializer | host catalog', function (hooks) {
|
||||
const normalized = serializer.normalizeSingleResponse(
|
||||
store,
|
||||
hostCatalog,
|
||||
payload
|
||||
payload,
|
||||
);
|
||||
assert.deepEqual(normalized, {
|
||||
data: {
|
||||
@@ -234,7 +234,7 @@ module('Unit | Serializer | host catalog', function (hooks) {
|
||||
const normalized = serializer.normalizeSingleResponse(
|
||||
store,
|
||||
hostCatalog,
|
||||
payload
|
||||
payload,
|
||||
);
|
||||
assert.deepEqual(normalized, {
|
||||
data: {
|
||||
@@ -293,7 +293,7 @@ module('Unit | Serializer | host catalog', function (hooks) {
|
||||
const normalized = serializer.normalizeSingleResponse(
|
||||
store,
|
||||
hostCatalog,
|
||||
payload
|
||||
payload,
|
||||
);
|
||||
assert.deepEqual(normalized, {
|
||||
data: {
|
||||
|
||||
@@ -116,7 +116,7 @@ module('Unit | Serializer | host set', function (hooks) {
|
||||
const normalized = serializer.normalizeSingleResponse(
|
||||
store,
|
||||
hostSetModelClass,
|
||||
payload
|
||||
payload,
|
||||
);
|
||||
|
||||
assert.deepEqual(normalized, {
|
||||
@@ -153,7 +153,7 @@ module('Unit | Serializer | host set', function (hooks) {
|
||||
const normalized = serializer.normalizeSingleResponse(
|
||||
store,
|
||||
hostSet,
|
||||
payload
|
||||
payload,
|
||||
);
|
||||
assert.deepEqual(normalized, {
|
||||
included: [],
|
||||
@@ -191,7 +191,7 @@ module('Unit | Serializer | host set', function (hooks) {
|
||||
const normalized = serializer.normalizeSingleResponse(
|
||||
store,
|
||||
hostSetModelClass,
|
||||
payload
|
||||
payload,
|
||||
);
|
||||
|
||||
assert.deepEqual(normalized, {
|
||||
|
||||
@@ -204,7 +204,7 @@ module('Unit | Serializer | Managed group', function (hooks) {
|
||||
const normalized = serializer.normalizeSingleResponse(
|
||||
store,
|
||||
hostSetModelClass,
|
||||
payload
|
||||
payload,
|
||||
);
|
||||
|
||||
assert.deepEqual(normalized, {
|
||||
|
||||
@@ -64,7 +64,7 @@ module('Unit | Serializer | role', function (hooks) {
|
||||
const normalized = serializer.normalizeSingleResponse(
|
||||
store,
|
||||
roleModelClass,
|
||||
payload
|
||||
payload,
|
||||
);
|
||||
assert.deepEqual(normalized, {
|
||||
included: [],
|
||||
|
||||
@@ -248,7 +248,7 @@ module('Unit | Serializer | storage bucket', function (hooks) {
|
||||
const normalized = serializer.normalizeSingleResponse(
|
||||
store,
|
||||
hostSetModelClass,
|
||||
payload
|
||||
payload,
|
||||
);
|
||||
|
||||
assert.deepEqual(normalized, {
|
||||
|
||||
@@ -354,7 +354,7 @@ module('Unit | Serializer | target', function (hooks) {
|
||||
const normalized = serializer.normalizeSingleResponse(
|
||||
store,
|
||||
targetModelClass,
|
||||
payload
|
||||
payload,
|
||||
);
|
||||
assert.deepEqual(normalized, {
|
||||
included: [],
|
||||
@@ -391,7 +391,7 @@ module('Unit | Serializer | target', function (hooks) {
|
||||
const normalized = serializer.normalizeSingleResponse(
|
||||
store,
|
||||
targetModelClass,
|
||||
payload
|
||||
payload,
|
||||
);
|
||||
assert.deepEqual(normalized, {
|
||||
included: [],
|
||||
@@ -424,7 +424,7 @@ module('Unit | Serializer | target', function (hooks) {
|
||||
const normalized = serializer.normalizeSingleResponse(
|
||||
store,
|
||||
target,
|
||||
payload
|
||||
payload,
|
||||
);
|
||||
assert.deepEqual(normalized, {
|
||||
included: [],
|
||||
@@ -457,7 +457,7 @@ module('Unit | Serializer | target', function (hooks) {
|
||||
const normalized = serializer.normalizeSingleResponse(
|
||||
store,
|
||||
target,
|
||||
payload
|
||||
payload,
|
||||
);
|
||||
assert.deepEqual(normalized, {
|
||||
included: [],
|
||||
@@ -490,7 +490,7 @@ module('Unit | Serializer | target', function (hooks) {
|
||||
const normalized = serializer.normalizeSingleResponse(
|
||||
store,
|
||||
target,
|
||||
payload
|
||||
payload,
|
||||
);
|
||||
assert.deepEqual(normalized, {
|
||||
included: [],
|
||||
@@ -523,7 +523,7 @@ module('Unit | Serializer | target', function (hooks) {
|
||||
const normalized = serializer.normalizeSingleResponse(
|
||||
store,
|
||||
target,
|
||||
payload
|
||||
payload,
|
||||
);
|
||||
assert.deepEqual(normalized, {
|
||||
included: [],
|
||||
@@ -557,7 +557,7 @@ module('Unit | Serializer | target', function (hooks) {
|
||||
const normalized = serializer.normalizeSingleResponse(
|
||||
store,
|
||||
target,
|
||||
payload
|
||||
payload,
|
||||
);
|
||||
assert.deepEqual(normalized, {
|
||||
included: [],
|
||||
|
||||
Reference in new issue
Block a user