Skip to content
This repository has been archived by the owner on Mar 27, 2019. It is now read-only.

Policy Management #4

Merged
merged 6 commits into from
Nov 9, 2016
Merged

Policy Management #4

merged 6 commits into from
Nov 9, 2016

Conversation

djenriquez
Copy link
Owner

  • Allow tokens with respective access to perform CRUD operations against policies

DJ Enriquez added 3 commits November 8, 2016 14:19

axios.put(`/policy?vaultaddr=${encodeURI(window.localStorage.getItem("vaultUrl"))}&policy=${encodeURI(policyName)}&token=${encodeURI(window.localStorage.getItem("vaultAccessToken"))}`, { "Policy": this.state.currentPolicy })
.then((resp) => {
if (resp.status === 200) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the point of this?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

placeholder, removed the 200 check though

}

updatePolicy() {
let policyName = `${this.state.editingPolicy}`;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for interpolation here

// Attempt to parse into JSON incase a stringified JSON was sent
try {
policy = JSON.parse(policy)
} catch(e) { }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should log these errors

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its not meant to be an error, rather a check if the string is a valid json, and if it is, make it an object

res.json(resp.data);
})
.catch((err) => {
//console.error(err);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this

@djenriquez djenriquez merged commit d90d5ea into master Nov 9, 2016
@djenriquez djenriquez deleted the policies branch November 9, 2016 06:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants