Refactor credential sources to brokered credential sources (#1264)
* chore: 🤖 refactor credential sources to brokered credential source
This commit is contained in:
1 parent
f4f7c0e343
commit
9a8665a314
21 files changed
+136
-110
No files matched your search
@@ -23,7 +23,7 @@ export default class TargetModel extends GeneratedTargetModel {
|
||||
|
||||
/**
|
||||
* Credential source ids are read only and can be
|
||||
* persisted via a dedicated call to `addCredentialSources()`.
|
||||
* persisted via a dedicated call to `addBrokeredCredentialSources()`.
|
||||
*/
|
||||
@fragmentArray('fragment-string', {
|
||||
readOnly: true,
|
||||
@@ -54,7 +54,7 @@ export default class TargetModel extends GeneratedTargetModel {
|
||||
* @type {[CredentialLibraryModel, CredentialModel]}
|
||||
*/
|
||||
@computed('brokered_credential_source_ids.[]', 'store')
|
||||
get credentialSources() {
|
||||
get brokeredCredentialSources() {
|
||||
return this.brokered_credential_source_ids
|
||||
.map((source) => {
|
||||
if (source.value.startsWith('cred')) {
|
||||
@@ -161,7 +161,10 @@ export default class TargetModel extends GeneratedTargetModel {
|
||||
* @param {object} options.adapterOptions
|
||||
* @return {Promise}
|
||||
*/
|
||||
addCredentialSources(credentialSourceIDs, options = { adapterOptions: {} }) {
|
||||
addBrokeredCredentialSources(
|
||||
credentialSourceIDs,
|
||||
options = { adapterOptions: {} }
|
||||
) {
|
||||
const defaultAdapterOptions = {
|
||||
method: 'add-credential-sources',
|
||||
credentialSourceIDs,
|
||||
@@ -184,7 +187,7 @@ export default class TargetModel extends GeneratedTargetModel {
|
||||
* @param {object} options.adapterOptions
|
||||
* @return {Promise}
|
||||
*/
|
||||
removeCredentialSources(
|
||||
removeBrokeredCredentialSources(
|
||||
credentialSourceIDs,
|
||||
options = { adapterOptions: {} }
|
||||
) {
|
||||
@@ -208,8 +211,8 @@ export default class TargetModel extends GeneratedTargetModel {
|
||||
* @param {object} options
|
||||
* @return {Promise}
|
||||
*/
|
||||
removeCredentialSource(credentialSourceID, options) {
|
||||
return this.removeCredentialSources([credentialSourceID], options);
|
||||
removeBrokeredCredentialSource(credentialSourceID, options) {
|
||||
return this.removeBrokeredCredentialSources([credentialSourceID], options);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user