Skip to content

Commit

Permalink
UI: Skip OpenAPI call for unmanaged auth methods (#25364)
Browse files Browse the repository at this point in the history
* Skip fetching OpenAPI if the auth method is not managable in the UI. Fixes #24160

* remove map

* add changelog
  • Loading branch information
hashishaw committed Feb 14, 2024
1 parent 6cfd098 commit 95e0e41
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions changelog/25364.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
ui: remove unnecessary OpenAPI calls for unmanaged auth methods
```
10 changes: 10 additions & 0 deletions ui/app/routes/vault/cluster/access/method.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import AdapterError from '@ember-data/adapter/error';
import { set } from '@ember/object';
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
import { supportedManagedAuthBackends } from 'vault/helpers/supported-managed-auth-backends';

export default Route.extend({
store: service(),
Expand All @@ -21,6 +22,15 @@ export default Route.extend({
set(error, 'httpStatus', 404);
throw error;
}
const supportManaged = supportedManagedAuthBackends();
if (!supportManaged.includes(model.methodType)) {
// do not fetch path-help for unmanaged auth types
model.set('paths', {
apiPath: model.apiPath,
paths: [],
});
return model;
}
return this.pathHelp.getPaths(model.apiPath, path).then((paths) => {
model.set('paths', paths);
return model;
Expand Down

0 comments on commit 95e0e41

Please sign in to comment.