Skip to content

Commit

Permalink
fix: management methods throwing error on access
Browse files Browse the repository at this point in the history
  • Loading branch information
pmalouin committed Jun 19, 2020
1 parent b3fd832 commit dde3721
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
12 changes: 6 additions & 6 deletions src/management/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2558,7 +2558,7 @@ utils.wrapPropertyMethod(ManagementClient, 'deleteCustomDomain', 'customDomains.
utils.wrapPropertyMethod(
ManagementClient,
'createGuardianEnrollmentTicket',
'guardian.tickets.create'
'guardian.createEnrollmentTicket'
);

/**
Expand All @@ -2576,7 +2576,7 @@ utils.wrapPropertyMethod(
*
* @return {Promise|undefined}
*/
utils.wrapPropertyMethod(ManagementClient, 'getGuardianFactors', 'guardian.factors.getAll');
utils.wrapPropertyMethod(ManagementClient, 'getGuardianFactors', 'guardian.getFactors');

/**
* Get Guardian factor provider configuration
Expand All @@ -2597,7 +2597,7 @@ utils.wrapPropertyMethod(ManagementClient, 'getGuardianFactors', 'guardian.facto
utils.wrapPropertyMethod(
ManagementClient,
'getGuardianFactorProvider',
'guardian.factorsProviders.get'
'guardian.getFactorProvider'
);

/**
Expand All @@ -2624,7 +2624,7 @@ utils.wrapPropertyMethod(
utils.wrapPropertyMethod(
ManagementClient,
'updateGuardianFactorProvider',
'guardian.factorsProviders.update'
'guardian.updateFactorProvider'
);

/**
Expand All @@ -2646,7 +2646,7 @@ utils.wrapPropertyMethod(
utils.wrapPropertyMethod(
ManagementClient,
'getGuardianFactorTemplates',
'guardian.factorsTemplates.get'
'guardian.getFactorTemplates'
);

/**
Expand Down Expand Up @@ -2694,7 +2694,7 @@ utils.wrapPropertyMethod(
*
* @return {Promise|undefined}
*/
utils.wrapPropertyMethod(ManagementClient, 'updateGuardianFactor', 'guardian.factors.update');
utils.wrapPropertyMethod(ManagementClient, 'updateGuardianFactor', 'guardian.updateFactor');

/**
* Get all roles.
Expand Down
16 changes: 10 additions & 6 deletions test/management/management-client.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,6 @@ describe('ManagementClient', function() {
});

describe('instance methods', function() {
var method;
var methods = [
'getConnections',
'createConnection',
Expand Down Expand Up @@ -839,7 +838,7 @@ describe('ManagementClient', function() {
'getUsers',
'getUser',
'deleteAllUsers',
'deleteUsers',
'deleteUser',
'createUser',
'updateUser',
'getBlacklistedTokens',
Expand All @@ -860,6 +859,13 @@ describe('ManagementClient', function() {
'setRulesConfig',
'getRulesConfigs',
'deleteRulesConfig',
'createGuardianEnrollmentTicket',
'getGuardianFactors',
'getGuardianFactorProvider',
'updateGuardianFactorProvider',
'getGuardianFactorTemplates',
'updateGuardianFactorTemplates',
'updateGuardianFactor',
'getUserBlocks',
'unblockUser',
'getUserBlocksByIdentifier',
Expand All @@ -872,12 +878,10 @@ describe('ManagementClient', function() {
this.client = new ManagementClient(config);
});

for (var i = 0, l = methods.length; i < l; i++) {
method = methods[i];

methods.forEach(function (method) {
it('should have a ' + method + ' method', function() {
expect(this.client[method]).to.exist.to.be.an.instanceOf(Function);
});
}
});
});
});

0 comments on commit dde3721

Please sign in to comment.