Slightly more restrictive API access

This commit is contained in:
catbref 2020-03-04 15:41:19 +00:00
parent 2dffd382ae
commit 450ff7318f

View File

@ -202,6 +202,8 @@ public class AdminResource {
) )
@ApiErrors({ApiError.REPOSITORY_ISSUE}) @ApiErrors({ApiError.REPOSITORY_ISSUE})
public List<MintingAccountData> getMintingAccounts() { public List<MintingAccountData> getMintingAccounts() {
Security.checkApiCallAllowed(request);
try (final Repository repository = RepositoryManager.getRepository()) { try (final Repository repository = RepositoryManager.getRepository()) {
List<MintingAccountData> mintingAccounts = repository.getAccountRepository().getMintingAccounts(); List<MintingAccountData> mintingAccounts = repository.getAccountRepository().getMintingAccounts();
@ -246,6 +248,8 @@ public class AdminResource {
) )
@ApiErrors({ApiError.INVALID_PRIVATE_KEY, ApiError.REPOSITORY_ISSUE, ApiError.CANNOT_MINT}) @ApiErrors({ApiError.INVALID_PRIVATE_KEY, ApiError.REPOSITORY_ISSUE, ApiError.CANNOT_MINT})
public String addMintingAccount(String seed58) { public String addMintingAccount(String seed58) {
Security.checkApiCallAllowed(request);
try (final Repository repository = RepositoryManager.getRepository()) { try (final Repository repository = RepositoryManager.getRepository()) {
byte[] seed = Base58.decode(seed58.trim()); byte[] seed = Base58.decode(seed58.trim());
@ -296,6 +300,8 @@ public class AdminResource {
) )
@ApiErrors({ApiError.INVALID_PRIVATE_KEY, ApiError.REPOSITORY_ISSUE}) @ApiErrors({ApiError.INVALID_PRIVATE_KEY, ApiError.REPOSITORY_ISSUE})
public String deleteMintingAccount(String seed58) { public String deleteMintingAccount(String seed58) {
Security.checkApiCallAllowed(request);
try (final Repository repository = RepositoryManager.getRepository()) { try (final Repository repository = RepositoryManager.getRepository()) {
byte[] seed = Base58.decode(seed58.trim()); byte[] seed = Base58.decode(seed58.trim());