Skip to content

Commit

Permalink
Duplicate Content-Header for GET /api/vaults/{vaultId}/access-token #265
Browse files Browse the repository at this point in the history
.
  • Loading branch information
chenkins committed Jun 7, 2024
1 parent 645c013 commit 5f292ab
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@ public Response legacyUnlock(@PathParam("vaultId") UUID vaultId, @PathParam("dev
@RolesAllowed("user")
@VaultRole({VaultAccess.Role.MEMBER, VaultAccess.Role.OWNER}) // may throw 403
@Transactional
@Produces(MediaType.TEXT_PLAIN)
@Operation(summary = "get the user-specific vault key", description = "retrieves a jwe containing the vault key, encrypted for the current user")
@APIResponse(responseCode = "200")
@APIResponse(responseCode = "402", description = "license expired or number of effective vault users that have a token exceeds available license seats")
Expand Down Expand Up @@ -322,7 +321,7 @@ public Response unlock(@PathParam("vaultId") UUID vaultId, @QueryParam("evenIfAr
eventLogger.logVaultKeyRetrieved(jwt.getSubject(), vaultId, VaultKeyRetrievedEvent.Result.SUCCESS);
var subscriptionStateHeaderName = "Hub-Subscription-State";
var subscriptionStateHeaderValue = license.isSet() ? "ACTIVE" : "INACTIVE"; // license expiration is not checked here, because it is checked in the ActiveLicense filter
return Response.ok(access.getVaultKey()).header(subscriptionStateHeaderName, subscriptionStateHeaderValue).build();
return Response.ok(access.getVaultKey(), MediaType.TEXT_PLAIN_TYPE).header(subscriptionStateHeaderName, subscriptionStateHeaderValue).build();
} else if (vaultRepo.findById(vaultId) == null) {
throw new NotFoundException("No such vault.");
} else {
Expand Down

0 comments on commit 5f292ab

Please sign in to comment.