Merge branch 'main' into feature-auth-methods-filters

This commit is contained in:
Randall Morey authored and GitHub committed 2021-11-12 09:26:33 -05:00
commit 6b363b9dad
43 files changed
+763 -15

No files matched your search

+8
View File
@@ -5,6 +5,14 @@ import { A } from '@ember/array';
export default class ManagedGroupModel extends GeneratedManagedGroupModel {
// =attributes
// =error attributes
// These attributes exist solely to capture errors on nested fields.
// See the application adapter's error normalization method for
// more information.
@attr('string', { readOnly: true }) attributes_filter;
/**
* Members is read-only under normal circumstances. But members can
* be persisted via calls to `addMembers()` or `removeMembers()`.
@@ -1,3 +1,10 @@
import ApplicationSerializer from './application';
export default class ManagedGroupSerializer extends ApplicationSerializer {}
export default class ManagedGroupSerializer extends ApplicationSerializer {
// =properties
/**
* @type {boolean}
*/
serializeScopeID = false;
}
@@ -0,0 +1 @@
export { default } from 'api/serializers/managed-group';
+3
View File
@@ -522,6 +522,9 @@ export default function () {
return managedGroups.where({ authMethodId });
}
);
this.get('/managed-groups/:id');
this.del('/managed-groups/:id');
this.post('/managed-groups');
/* Uncomment the following line and the Response import above
* Then change the response code to simulate error responses.
+4 -1
View File
@@ -15,6 +15,7 @@ export default factory.extend({
authorized_collection_actions: () => {
return {
accounts: ['create', 'list'],
'managed-groups': ['create', 'list'],
};
},
id: (i) => `auth-method-id-${i}`,
@@ -34,7 +35,9 @@ export default factory.extend({
user.update({ accountIds: [id] });
});
server.createList('managed-group', 2, { scope, authMethod });
if (type === 'oidc') {
server.createList('managed-group', 2, { scope, authMethod });
}
},
}),
});
@@ -1,8 +1,12 @@
import factory from '../generated/factories/managed-group';
import { random } from 'faker';
import permissions from '../helpers/permissions';
const types = ['oidc'];
export default factory.extend({
id: (i) => `managed-groups-id-${i}`,
type: (i) => types[i % types.length],
authorized_actions: () =>
permissions.authorizedActionsFor('managed-group') || [
@@ -11,4 +15,13 @@ export default factory.extend({
'update',
'delete',
],
attributes() {
switch (this.type) {
case 'oidc':
return {
filter: random.words(),
};
}
},
});
@@ -11,15 +11,4 @@ export default Factory.extend({
created_time: () => date.recent(),
updated_time: () => date.recent(),
version: () => datatype.number(),
type: 'oidc',
attributes: function () {
switch (this.type) {
case 'oidc':
return {
filter: random.words(),
};
default:
return;
}
},
});
+1 -1
View File
@@ -22,7 +22,7 @@ export default function (server) {
// Auth
const globalAuthMethods = server.createList(
'auth-method',
1,
4,
{ scope: globalScope },
'withAccountsAndUsersAndManagedGroups'
);