Skip to content
This repository has been archived by the owner on Nov 22, 2023. It is now read-only.

Commit

Permalink
Renames SecretSeriesJooqDao → SecretSeriesDAO.
Browse files Browse the repository at this point in the history
  • Loading branch information
alokmenghrajani committed Apr 22, 2015
1 parent a1dd051 commit 81a502b
Show file tree
Hide file tree
Showing 12 changed files with 86 additions and 85 deletions.
26 changes: 13 additions & 13 deletions server/src/main/java/keywhiz/ServiceModule.java
Expand Up @@ -61,7 +61,7 @@
import keywhiz.service.daos.SecretContentDAO; import keywhiz.service.daos.SecretContentDAO;
import keywhiz.service.daos.SecretController; import keywhiz.service.daos.SecretController;
import keywhiz.service.daos.SecretDAO; import keywhiz.service.daos.SecretDAO;
import keywhiz.service.daos.SecretSeriesJooqDao; import keywhiz.service.daos.SecretSeriesDAO;
import org.jooq.DSLContext; import org.jooq.DSLContext;
import org.jooq.impl.DSL; import org.jooq.impl.DSL;
import org.skife.jdbi.v2.ColonPrefixNamedParamStatementRewriter; import org.skife.jdbi.v2.ColonPrefixNamedParamStatementRewriter;
Expand Down Expand Up @@ -216,15 +216,15 @@ public ServiceModule(KeywhizConfig config, Environment environment) {


@Provides @Singleton AclDAO aclDAO(DSLContext jooqContext, ClientDAO clientDAO, @Provides @Singleton AclDAO aclDAO(DSLContext jooqContext, ClientDAO clientDAO,
GroupDAO groupDAO, SecretContentDAO secretContentDAO, GroupDAO groupDAO, SecretContentDAO secretContentDAO,
SecretSeriesJooqDao secretSeriesJooqDao) { SecretSeriesDAO secretSeriesDAO) {
return new AclDAO(jooqContext, clientDAO, groupDAO, secretContentDAO, secretSeriesJooqDao); return new AclDAO(jooqContext, clientDAO, groupDAO, secretContentDAO, secretSeriesDAO);
} }


@Provides @Singleton @Provides @Singleton
@Readonly AclDAO readonlyAclDAO(@Readonly DSLContext jooqContext, @Readonly ClientDAO clientDAO, @Readonly AclDAO readonlyAclDAO(@Readonly DSLContext jooqContext, @Readonly ClientDAO clientDAO,
@Readonly GroupDAO groupDAO, @Readonly SecretContentDAO secretContentDAO, @Readonly GroupDAO groupDAO, @Readonly SecretContentDAO secretContentDAO,
@Readonly SecretSeriesJooqDao secretSeriesJooqDao) { @Readonly SecretSeriesDAO secretSeriesDAO) {
return new AclDAO(jooqContext, clientDAO, groupDAO, secretContentDAO, secretSeriesJooqDao); return new AclDAO(jooqContext, clientDAO, groupDAO, secretContentDAO, secretSeriesDAO);
} }


@Provides @Singleton ClientDAO clientDAO(DSLContext jooqContext) { @Provides @Singleton ClientDAO clientDAO(DSLContext jooqContext) {
Expand Down Expand Up @@ -252,25 +252,25 @@ public ServiceModule(KeywhizConfig config, Environment environment) {
return new SecretContentDAO(jooqContext); return new SecretContentDAO(jooqContext);
} }


@Provides @Singleton SecretSeriesJooqDao secretSeriesJooqDao(DSLContext jooqContext) { @Provides @Singleton SecretSeriesDAO secretSeriesDAO(DSLContext jooqContext) {
return new SecretSeriesJooqDao(jooqContext); return new SecretSeriesDAO(jooqContext);
} }


@Provides @Singleton @Provides @Singleton
@Readonly SecretSeriesJooqDao readonlySecretSeriesJooqDao(@Readonly DSLContext jooqContext) { @Readonly SecretSeriesDAO readonlySecretSeriesDAO(@Readonly DSLContext jooqContext) {
return new SecretSeriesJooqDao(jooqContext); return new SecretSeriesDAO(jooqContext);
} }


@Provides @Singleton SecretDAO secretDAO(DSLContext jooqContext, @Provides @Singleton SecretDAO secretDAO(DSLContext jooqContext,
SecretContentDAO secretContentDAO, SecretSeriesJooqDao secretSeriesJooqDao) { SecretContentDAO secretContentDAO, SecretSeriesDAO secretSeriesDAO) {
return new SecretDAO(jooqContext, secretContentDAO, secretSeriesJooqDao); return new SecretDAO(jooqContext, secretContentDAO, secretSeriesDAO);
} }


@Provides @Singleton @Provides @Singleton
@Readonly SecretDAO readonlySecretDAO(@Readonly DSLContext jooqContext, @Readonly SecretDAO readonlySecretDAO(@Readonly DSLContext jooqContext,
@Readonly SecretContentDAO secretContentDAO, @Readonly SecretContentDAO secretContentDAO,
@Readonly SecretSeriesJooqDao secretSeriesJooqDao) { @Readonly SecretSeriesDAO secretSeriesDAO) {
return new SecretDAO(jooqContext, secretContentDAO, secretSeriesJooqDao); return new SecretDAO(jooqContext, secretContentDAO, secretSeriesDAO);
} }


@Provides @Singleton @Provides @Singleton
Expand Down
16 changes: 8 additions & 8 deletions server/src/main/java/keywhiz/service/daos/AclDAO.java
Expand Up @@ -51,15 +51,15 @@ public class AclDAO {
private ClientDAO clientDAO; private ClientDAO clientDAO;
private GroupDAO groupDAO; private GroupDAO groupDAO;
private SecretContentDAO secretContentDAO; private SecretContentDAO secretContentDAO;
private SecretSeriesJooqDao secretSeriesJooqDao; private SecretSeriesDAO secretSeriesDAO;


@Inject @Inject
public AclDAO(DSLContext dslContext, ClientDAO clientDAO, GroupDAO groupDAO, SecretContentDAO secretContentDAO, SecretSeriesJooqDao secretSeriesJooqDao) { public AclDAO(DSLContext dslContext, ClientDAO clientDAO, GroupDAO groupDAO, SecretContentDAO secretContentDAO, SecretSeriesDAO secretSeriesDAO) {
this.dslContext = dslContext; this.dslContext = dslContext;
this.clientDAO = clientDAO; this.clientDAO = clientDAO;
this.groupDAO = groupDAO; this.groupDAO = groupDAO;
this.secretContentDAO = secretContentDAO; this.secretContentDAO = secretContentDAO;
this.secretSeriesJooqDao = secretSeriesJooqDao; this.secretSeriesDAO = secretSeriesDAO;
} }


public void findAndAllowAccess(long secretId, long groupId) { public void findAndAllowAccess(long secretId, long groupId) {
Expand All @@ -71,7 +71,7 @@ public void findAndAllowAccess(long secretId, long groupId) {
throw new IllegalStateException(format("GroupId %d doesn't exist.", groupId)); throw new IllegalStateException(format("GroupId %d doesn't exist.", groupId));
} }


Optional<SecretSeries> secret = secretSeriesJooqDao.getSecretSeriesById(secretId); Optional<SecretSeries> secret = secretSeriesDAO.getSecretSeriesById(secretId);
if (!secret.isPresent()) { if (!secret.isPresent()) {
logger.info("Failure to allow access groupId {}, secretId {}: secretId not found.", groupId, logger.info("Failure to allow access groupId {}, secretId {}: secretId not found.", groupId,
secretId); secretId);
Expand All @@ -91,7 +91,7 @@ public void findAndRevokeAccess(long secretId, long groupId) {
throw new IllegalStateException(format("GroupId %d doesn't exist.", groupId)); throw new IllegalStateException(format("GroupId %d doesn't exist.", groupId));
} }


Optional<SecretSeries> secret = secretSeriesJooqDao.getSecretSeriesById(secretId); Optional<SecretSeries> secret = secretSeriesDAO.getSecretSeriesById(secretId);
if (!secret.isPresent()) { if (!secret.isPresent()) {
logger.info("Failure to revoke access groupId {}, secretId {}: secretId not found.", logger.info("Failure to revoke access groupId {}, secretId {}: secretId not found.",
groupId, secretId); groupId, secretId);
Expand Down Expand Up @@ -290,7 +290,7 @@ protected ImmutableSet<SecretSeries> getSecretSeriesFor(Group group) {
.join(GROUPS).on(GROUPS.ID.eq(ACCESSGRANTS.GROUPID)) .join(GROUPS).on(GROUPS.ID.eq(ACCESSGRANTS.GROUPID))
.where(GROUPS.NAME.eq(group.getName())) .where(GROUPS.NAME.eq(group.getName()))
.fetch() .fetch()
.map(new SecretSeriesJooqMapper()); .map(new SecretSeriesMapper());
return ImmutableSet.copyOf(r); return ImmutableSet.copyOf(r);


} }
Expand All @@ -305,7 +305,7 @@ protected ImmutableSet<SecretSeries> getSecretSeriesFor(Client client) {
.join(CLIENTS).on(CLIENTS.ID.eq(MEMBERSHIPS.CLIENTID)) .join(CLIENTS).on(CLIENTS.ID.eq(MEMBERSHIPS.CLIENTID))
.where(CLIENTS.NAME.eq(client.getName())) .where(CLIENTS.NAME.eq(client.getName()))
.fetch() .fetch()
.map(new SecretSeriesJooqMapper()); .map(new SecretSeriesMapper());
return ImmutableSet.copyOf(r); return ImmutableSet.copyOf(r);
} }


Expand All @@ -328,6 +328,6 @@ protected Optional<SecretSeries> getSecretSeriesFor(Client client, String name)
.where(SECRETS.NAME.eq(name).and(CLIENTS.NAME.eq(client.getName()))) .where(SECRETS.NAME.eq(name).and(CLIENTS.NAME.eq(client.getName())))
.fetchOne(); .fetchOne();


return Optional.ofNullable(r).map((rec) -> rec.map(new SecretSeriesJooqMapper())); return Optional.ofNullable(r).map((rec) -> rec.map(new SecretSeriesMapper()));
} }
} }
34 changes: 18 additions & 16 deletions server/src/main/java/keywhiz/service/daos/SecretDAO.java
Expand Up @@ -34,20 +34,20 @@
/** /**
* Primary class to interact with {@link Secret}s. * Primary class to interact with {@link Secret}s.
* *
* Does not map to a table itself, but utilizes both {@link SecretSeriesJooqDao} and * Does not map to a table itself, but utilizes both {@link SecretSeriesDAO} and
* {@link SecretContentDAO} to provide a more usable API. * {@link SecretContentDAO} to provide a more usable API.
*/ */
public class SecretDAO { public class SecretDAO {
private final DSLContext dslContext; private final DSLContext dslContext;
private SecretContentDAO secretContentDAO; private SecretContentDAO secretContentDAO;
private SecretSeriesJooqDao secretSeriesJooqDao; private SecretSeriesDAO secretSeriesDAO;


@Inject @Inject
public SecretDAO(DSLContext dslContext, SecretContentDAO secretContentDAO, public SecretDAO(DSLContext dslContext, SecretContentDAO secretContentDAO,
SecretSeriesJooqDao secretSeriesJooqDao) { SecretSeriesDAO secretSeriesDAO) {
this.dslContext = dslContext; this.dslContext = dslContext;
this.secretContentDAO = secretContentDAO; this.secretContentDAO = secretContentDAO;
this.secretSeriesJooqDao = secretSeriesJooqDao; this.secretSeriesDAO = secretSeriesDAO;
} }


@VisibleForTesting @VisibleForTesting
Expand All @@ -57,12 +57,12 @@ public long createSecret(String name, String encryptedSecret, String version,
// TODO(jlfwong): Should the description be updated...? // TODO(jlfwong): Should the description be updated...?


return dslContext.transactionResult(configuration -> { return dslContext.transactionResult(configuration -> {
Optional<SecretSeries> secretSeries = secretSeriesJooqDao.getSecretSeriesByName(name); Optional<SecretSeries> secretSeries = secretSeriesDAO.getSecretSeriesByName(name);
long secretId; long secretId;
if (secretSeries.isPresent()) { if (secretSeries.isPresent()) {
secretId = secretSeries.get().getId(); secretId = secretSeries.get().getId();
} else { } else {
secretId = secretSeriesJooqDao.createSecretSeries(name, creator, description, type, secretId = secretSeriesDAO.createSecretSeries(name, creator, description, type,
generationOptions); generationOptions);
} }


Expand All @@ -80,9 +80,10 @@ public ImmutableList<SecretSeriesAndContent> getSecretsById(long secretId) {
return dslContext.transactionResult(configuration -> { return dslContext.transactionResult(configuration -> {
ImmutableList.Builder<SecretSeriesAndContent> secretsBuilder = ImmutableList.builder(); ImmutableList.Builder<SecretSeriesAndContent> secretsBuilder = ImmutableList.builder();


Optional<SecretSeries> series = secretSeriesJooqDao.getSecretSeriesById(secretId); Optional<SecretSeries> series = secretSeriesDAO.getSecretSeriesById(secretId);
if (series.isPresent()) { if (series.isPresent()) {
ImmutableList<SecretContent> contents = secretContentDAO.getSecretContentsBySecretId(secretId); ImmutableList<SecretContent> contents =
secretContentDAO.getSecretContentsBySecretId(secretId);
for (SecretContent content : contents) { for (SecretContent content : contents) {
secretsBuilder.add(SecretSeriesAndContent.of(series.get(), content)); secretsBuilder.add(SecretSeriesAndContent.of(series.get(), content));
} }
Expand All @@ -102,7 +103,7 @@ public Optional<SecretSeriesAndContent> getSecretByIdAndVersion(long secretId, S


// Cast to fix issue with mvn + java8 (not showing up in Intellij). // Cast to fix issue with mvn + java8 (not showing up in Intellij).
return dslContext.<Optional<SecretSeriesAndContent>>transactionResult(configuration -> { return dslContext.<Optional<SecretSeriesAndContent>>transactionResult(configuration -> {
Optional<SecretSeries> series = secretSeriesJooqDao.getSecretSeriesById(secretId); Optional<SecretSeries> series = secretSeriesDAO.getSecretSeriesById(secretId);
if (!series.isPresent()) { if (!series.isPresent()) {
return Optional.empty(); return Optional.empty();
} }
Expand All @@ -126,7 +127,7 @@ public ImmutableList<String> getVersionsForSecretName(String name) {


// Cast to fix issue with mvn + java8 (not showing up in Intellij). // Cast to fix issue with mvn + java8 (not showing up in Intellij).
return dslContext.<ImmutableList<String>>transactionResult(configuration -> { return dslContext.<ImmutableList<String>>transactionResult(configuration -> {
Optional<SecretSeries> series = secretSeriesJooqDao.getSecretSeriesByName(name); Optional<SecretSeries> series = secretSeriesDAO.getSecretSeriesByName(name);
if (!series.isPresent()) { if (!series.isPresent()) {
return ImmutableList.of(); return ImmutableList.of();
} }
Expand All @@ -146,7 +147,7 @@ public Optional<SecretSeriesAndContent> getSecretByNameAndVersion(String name, S


// Cast to fix issue with mvn + java8 (not showing up in Intellij). // Cast to fix issue with mvn + java8 (not showing up in Intellij).
return dslContext.<Optional<SecretSeriesAndContent>>transactionResult(configuration -> { return dslContext.<Optional<SecretSeriesAndContent>>transactionResult(configuration -> {
Optional<SecretSeries> secretSeries = secretSeriesJooqDao.getSecretSeriesByName(name); Optional<SecretSeries> secretSeries = secretSeriesDAO.getSecretSeriesByName(name);
if (!secretSeries.isPresent()) { if (!secretSeries.isPresent()) {
return Optional.empty(); return Optional.empty();
} }
Expand All @@ -167,9 +168,10 @@ public ImmutableList<SecretSeriesAndContent> getSecrets() {
return dslContext.transactionResult(configuration -> { return dslContext.transactionResult(configuration -> {
ImmutableList.Builder<SecretSeriesAndContent> secretsBuilder = ImmutableList.builder(); ImmutableList.Builder<SecretSeriesAndContent> secretsBuilder = ImmutableList.builder();


secretSeriesJooqDao.getSecretSeries() secretSeriesDAO.getSecretSeries()
.forEach((series) -> secretContentDAO.getSecretContentsBySecretId(series.getId()) .forEach((series) -> secretContentDAO.getSecretContentsBySecretId(series.getId())
.forEach((content) -> secretsBuilder.add(SecretSeriesAndContent.of(series, content)))); .forEach(
(content) -> secretsBuilder.add(SecretSeriesAndContent.of(series, content))));


return secretsBuilder.build(); return secretsBuilder.build();
}); });
Expand All @@ -182,7 +184,7 @@ public ImmutableList<SecretSeriesAndContent> getSecrets() {
*/ */
public void deleteSecretsByName(String name) { public void deleteSecretsByName(String name) {
checkArgument(!name.isEmpty()); checkArgument(!name.isEmpty());
secretSeriesJooqDao.deleteSecretSeriesByName(name); secretSeriesDAO.deleteSecretSeriesByName(name);
} }


/** /**
Expand All @@ -196,7 +198,7 @@ public void deleteSecretByNameAndVersion(String name, String version) {
checkNotNull(version); checkNotNull(version);


dslContext.transaction(configuration -> { dslContext.transaction(configuration -> {
Optional<SecretSeries> secretSeries = secretSeriesJooqDao.getSecretSeriesByName(name); Optional<SecretSeries> secretSeries = secretSeriesDAO.getSecretSeriesByName(name);
if (!secretSeries.isPresent()) { if (!secretSeries.isPresent()) {
return; return;
} }
Expand All @@ -206,7 +208,7 @@ public void deleteSecretByNameAndVersion(String name, String version) {


long seriesId = secretSeries.get().getId(); long seriesId = secretSeries.get().getId();
if (secretContentDAO.getSecretContentsBySecretId(seriesId).isEmpty()) { if (secretContentDAO.getSecretContentsBySecretId(seriesId).isEmpty()) {
secretSeriesJooqDao.deleteSecretSeriesById(seriesId); secretSeriesDAO.deleteSecretSeriesById(seriesId);
} }
}); });
} }
Expand Down
Expand Up @@ -30,17 +30,16 @@
import keywhiz.api.model.SecretSeries; import keywhiz.api.model.SecretSeries;
import keywhiz.jooq.tables.records.SecretsRecord; import keywhiz.jooq.tables.records.SecretsRecord;
import org.jooq.DSLContext; import org.jooq.DSLContext;
import org.jooq.tools.json.JSONObject;


import static keywhiz.jooq.tables.Secrets.SECRETS; import static keywhiz.jooq.tables.Secrets.SECRETS;


public class SecretSeriesJooqDao { public class SecretSeriesDAO {
private final DSLContext dslContext; private final DSLContext dslContext;
private final ObjectMapper private final ObjectMapper
mapper = KeywhizService.customizeObjectMapper(Jackson.newObjectMapper()); mapper = KeywhizService.customizeObjectMapper(Jackson.newObjectMapper());


@Inject @Inject
public SecretSeriesJooqDao(DSLContext dslContext) { public SecretSeriesDAO(DSLContext dslContext) {
this.dslContext = dslContext; this.dslContext = dslContext;
} }


Expand Down Expand Up @@ -71,21 +70,21 @@ long createSecretSeries(String name, String creator, String description, @Nullab
public Optional<SecretSeries> getSecretSeriesById(long id) { public Optional<SecretSeries> getSecretSeriesById(long id) {
SecretsRecord r = dslContext.fetchOne(SECRETS, SECRETS.ID.eq(Math.toIntExact(id))); SecretsRecord r = dslContext.fetchOne(SECRETS, SECRETS.ID.eq(Math.toIntExact(id)));
return Optional.ofNullable(r).map( return Optional.ofNullable(r).map(
(rec) -> rec.map(new SecretSeriesJooqMapper())); (rec) -> rec.map(new SecretSeriesMapper()));
} }


public Optional<SecretSeries> getSecretSeriesByName(String name) { public Optional<SecretSeries> getSecretSeriesByName(String name) {
SecretsRecord r = dslContext.fetchOne(SECRETS, SECRETS.NAME.eq(name)); SecretsRecord r = dslContext.fetchOne(SECRETS, SECRETS.NAME.eq(name));
return Optional.ofNullable(r).map( return Optional.ofNullable(r).map(
(rec) -> rec.map(new SecretSeriesJooqMapper())); (rec) -> rec.map(new SecretSeriesMapper()));
} }


public ImmutableList<SecretSeries> getSecretSeries() { public ImmutableList<SecretSeries> getSecretSeries() {
List<SecretSeries> r = dslContext List<SecretSeries> r = dslContext
.select() .select()
.from(SECRETS) .from(SECRETS)
.fetch() .fetch()
.map(new SecretSeriesJooqMapper()); .map(new SecretSeriesMapper());


return ImmutableList.copyOf(r); return ImmutableList.copyOf(r);
} }
Expand Down
Expand Up @@ -30,7 +30,7 @@
import static java.lang.String.format; import static java.lang.String.format;
import static keywhiz.jooq.tables.Secrets.SECRETS; import static keywhiz.jooq.tables.Secrets.SECRETS;


class SecretSeriesJooqMapper implements RecordMapper<Record, SecretSeries> { class SecretSeriesMapper implements RecordMapper<Record, SecretSeries> {
private static final TypeReference MAP_STRING_STRING_TYPE = private static final TypeReference MAP_STRING_STRING_TYPE =
new TypeReference<Map<String, String>>() {}; new TypeReference<Map<String, String>>() {};
private final ObjectMapper mapper = KeywhizService.customizeObjectMapper(Jackson.newObjectMapper()); private final ObjectMapper mapper = KeywhizService.customizeObjectMapper(Jackson.newObjectMapper());
Expand Down
Expand Up @@ -42,7 +42,7 @@
import keywhiz.api.model.VersionGenerator; import keywhiz.api.model.VersionGenerator;
import keywhiz.service.daos.AclDAO; import keywhiz.service.daos.AclDAO;
import keywhiz.service.daos.SecretController; import keywhiz.service.daos.SecretController;
import keywhiz.service.daos.SecretSeriesJooqDao; import keywhiz.service.daos.SecretSeriesDAO;
import keywhiz.service.exceptions.ConflictException; import keywhiz.service.exceptions.ConflictException;
import org.jooq.exception.DataAccessException; import org.jooq.exception.DataAccessException;
import org.slf4j.Logger; import org.slf4j.Logger;
Expand All @@ -62,14 +62,14 @@ public class AutomationSecretResource {
private static final Logger logger = LoggerFactory.getLogger(AutomationSecretResource.class); private static final Logger logger = LoggerFactory.getLogger(AutomationSecretResource.class);
private final SecretController secretController; private final SecretController secretController;
private final AclDAO aclDAO; private final AclDAO aclDAO;
private final SecretSeriesJooqDao secretSeriesJooqDao; private final SecretSeriesDAO secretSeriesDAO;


@Inject @Inject
public AutomationSecretResource(SecretController secretController, AclDAO aclDAO, public AutomationSecretResource(SecretController secretController, AclDAO aclDAO,
SecretSeriesJooqDao secretSeriesJooqDao) { SecretSeriesDAO secretSeriesDAO) {
this.secretController = secretController; this.secretController = secretController;
this.aclDAO = aclDAO; this.aclDAO = aclDAO;
this.secretSeriesJooqDao = secretSeriesJooqDao; this.secretSeriesDAO = secretSeriesDAO;
} }


/** /**
Expand Down Expand Up @@ -199,9 +199,9 @@ public AutomationSecretResponse readSecretById(@Auth AutomationClient automation
public Response deleteSecretSeries(@Auth AutomationClient automationClient, public Response deleteSecretSeries(@Auth AutomationClient automationClient,
@PathParam("secretName") String secretName) { @PathParam("secretName") String secretName) {


secretSeriesJooqDao.getSecretSeriesByName(secretName) secretSeriesDAO.getSecretSeriesByName(secretName)
.orElseThrow(() -> new NotFoundException("Secret series not found.")); .orElseThrow(() -> new NotFoundException("Secret series not found."));
secretSeriesJooqDao.deleteSecretSeriesByName(secretName); secretSeriesDAO.deleteSecretSeriesByName(secretName);


return Response.ok().build(); return Response.ok().build();
} }
Expand Down
Expand Up @@ -48,7 +48,7 @@
import keywhiz.auth.User; import keywhiz.auth.User;
import keywhiz.service.daos.AclDAO; import keywhiz.service.daos.AclDAO;
import keywhiz.service.daos.SecretController; import keywhiz.service.daos.SecretController;
import keywhiz.service.daos.SecretSeriesJooqDao; import keywhiz.service.daos.SecretSeriesDAO;
import keywhiz.service.exceptions.ConflictException; import keywhiz.service.exceptions.ConflictException;
import org.jooq.exception.DataAccessException; import org.jooq.exception.DataAccessException;
import org.slf4j.Logger; import org.slf4j.Logger;
Expand All @@ -69,14 +69,14 @@ public class SecretsResource {


private final SecretController secretController; private final SecretController secretController;
private final AclDAO aclDAO; private final AclDAO aclDAO;
private final SecretSeriesJooqDao secretSeriesJooqDao; private final SecretSeriesDAO secretSeriesDAO;


@Inject @Inject
public SecretsResource(SecretController secretController, AclDAO aclDAO, public SecretsResource(SecretController secretController, AclDAO aclDAO,
SecretSeriesJooqDao secretSeriesJooqDao) { SecretSeriesDAO secretSeriesDAO) {
this.secretController = secretController; this.secretController = secretController;
this.aclDAO = aclDAO; this.aclDAO = aclDAO;
this.secretSeriesJooqDao = secretSeriesJooqDao; this.secretSeriesDAO = secretSeriesDAO;
} }


/** /**
Expand Down Expand Up @@ -225,7 +225,7 @@ public Response deleteSecret(@Auth User user, @PathParam("secretId") LongParam s
throw new NotFoundException("Secret not found."); throw new NotFoundException("Secret not found.");
} }


secretSeriesJooqDao.deleteSecretSeriesById(secretId.get()); secretSeriesDAO.deleteSecretSeriesById(secretId.get());
return Response.noContent().build(); return Response.noContent().build();
} }


Expand Down

0 comments on commit 81a502b

Please sign in to comment.