forked from hashicorp/vault
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* remove header used for backwards compatibility in KV mounts, and use v1 paths for v1, v2 paths for v2 * make the model hook always run * simplify adapter & serializer code for secrets * update tests * fix lease tests * address review feedback
- Loading branch information
Showing
20 changed files
with
159 additions
and
272 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import Ember from 'ember'; | ||
import SecretAdapter from './secret'; | ||
|
||
export default SecretAdapter.extend({ | ||
createOrUpdate(store, type, snapshot) { | ||
const serializer = store.serializerFor(type.modelName); | ||
const data = serializer.serialize(snapshot); | ||
const { id } = snapshot; | ||
|
||
return this.ajax(this.urlForSecret(snapshot.attr('backend'), id), 'POST', { | ||
data: { data }, | ||
}); | ||
}, | ||
|
||
urlForSecret(backend, id, infix = 'data') { | ||
let url = `${this.buildURL()}/${backend}/${infix}/`; | ||
if (!Ember.isEmpty(id)) { | ||
url = url + id; | ||
} | ||
return url; | ||
}, | ||
|
||
fetchByQuery(query, methodCall) { | ||
let { id, backend } = query; | ||
let args = [backend, id]; | ||
if (methodCall === 'query') { | ||
args.push('metadata'); | ||
} | ||
return this.ajax(this.urlForSecret(...args), 'GET', this.optionsForQuery(id, methodCall)).then(resp => { | ||
resp.id = id; | ||
return resp; | ||
}); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import SecretSerializer from './secret'; | ||
|
||
export default SecretSerializer.extend({ | ||
secretDataPath: 'data.data', | ||
}); |
Oops, something went wrong.