Skip to content

Correct spelling of policies #124

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/main/java/com/bettercloud/vault/api/Auth.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class Auth {
public static class TokenRequest implements Serializable {

@Getter private UUID id;
@Getter private List<String> polices;
@Getter private List<String> policies;
@Getter private Map<String, String> meta;
@Getter private Boolean noParent;
@Getter private Boolean noDefaultPolicy;
Expand All @@ -59,11 +59,11 @@ public TokenRequest id(final UUID id) {
}

/**
* @param polices (optional) A list of policies for the token. This must be a subset of the policies belonging to the token
* @return This object, with its polices field populated
* @param policies (optional) A list of policies for the token. This must be a subset of the policies belonging to the token
* @return This object, with its policies field populated
*/
public TokenRequest polices(final List<String> polices) {
this.polices = polices;
public TokenRequest policies(final List<String> policies) {
this.policies = policies;
return this;
}

Expand Down Expand Up @@ -189,8 +189,8 @@ public AuthResponse createToken(final TokenRequest tokenRequest, final String to
final JsonObject jsonObject = Json.object();

if (tokenRequest.id != null) jsonObject.add("id", tokenRequest.id.toString());
if (tokenRequest.polices != null && !tokenRequest.polices.isEmpty()) {
jsonObject.add("policies", Json.array(tokenRequest.polices.toArray(new String[tokenRequest.polices.size()])));//NOPMD
if (tokenRequest.policies != null && !tokenRequest.policies.isEmpty()) {
jsonObject.add("policies", Json.array(tokenRequest.policies.toArray(new String[tokenRequest.policies.size()])));//NOPMD
}
if (tokenRequest.meta != null && !tokenRequest.meta.isEmpty()) {
final JsonObject metaMap = Json.object();
Expand Down