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 authored and lbalmaceda committed Jun 19, 2020
1 parent b3fd832 commit 64165a6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
14 changes: 7 additions & 7 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 All @@ -2672,7 +2672,7 @@ utils.wrapPropertyMethod(
utils.wrapPropertyMethod(
ManagementClient,
'updateGuardianFactorTemplates',
'guardian.factorsTemplates.update'
'guardian.updateFactorTemplates'
);

/**
Expand All @@ -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 64165a6

Please sign in to comment.