-
Notifications
You must be signed in to change notification settings - Fork 4.4k
[UI] Ember Data Migration - Auth Method List/Config #31203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
CI Results: |
Build Results: |
constructor(data: T, context?: unknown) { | ||
Object.assign(this, data) as T; | ||
// pass in context (this) of Ember class (route, component etc.) where the resource is being constructed | ||
// this will be used to set the owner on the class so that services can be injected (if required) | ||
if (context) { | ||
setOwner(this, getOwner(context) as Owner); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment sums it up but basically since this is a native js class that is not instantiated by Ember there is no owner set. Ember will throw an error when attempting to inject a service on a class without an owner. Since resources are typically used within Ember based classes (route, controller, component) we can pass in the context (this) to the constructor and get the owner from it and then set that owner on the resource class so that service injection can happen.
ui/tests/integration/components/auth-method/configuration-test.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! My main questions are about extending <SecretsEngine>
here and about the use of listingVisibility
in the test, since that value should be a string (not a boolean)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for answering all of my questions! 🚀
* updates auth method list and config views to use api service * adds capabilities checks to auth methods route * fixes auth method config tests * updates SecretsEngine type to Mount * updates listingVisibility value in config test * adds missing copyright header
Description
This PR updates the auth method list and config views to use the auth method resource and api service.
✅ enterprise tests pass
TODO only if you're a HashiCorp employee
backport/
label that matches the desired release branch. Note that in the CE repo, the latest release branch will look likebackport/x.x.x
, but older release branches will bebackport/ent/x.x.x+ent
.of a public function, even if that change is in a CE file, double check that
applying the patch for this PR to the ENT repo and running tests doesn't
break any tests. Sometimes ENT only tests rely on public functions in CE
files.
in the PR description, commit message, or branch name.
description. Also, make sure the changelog is in this PR, not in your ENT PR.
PCI review checklist
Examples of changes to security controls include using new access control methods, adding or removing logging pipelines, etc.