mirror of
https://github.com/nsacyber/HIRS.git
synced 2025-04-08 11:54:27 +00:00
Some additional changes to fix UI errors after I was able to test
against another machine.
This commit is contained in:
parent
65a1105ff5
commit
556322ad39
@ -20,7 +20,7 @@ import java.util.Date;
|
||||
@NoArgsConstructor
|
||||
@Entity
|
||||
public class TPM2ProvisionerState {
|
||||
private static final int MAX_BLOB_SIZE = 65535;
|
||||
private static final int MAX_BLOB_SIZE = 16777215;
|
||||
|
||||
@Id
|
||||
private Long firstPartOfNonce;
|
||||
@ -88,7 +88,7 @@ public class TPM2ProvisionerState {
|
||||
/**
|
||||
* Convenience method for finding the {@link TPM2ProvisionerState} associated with the nonce.
|
||||
*
|
||||
* @param TPM2ProvisionerStateRepository the {@link TPM2ProvisionerStateRepository} to use when looking for the
|
||||
* @param tpm2ProvisionerStateRepository the {@link TPM2ProvisionerStateRepository} to use when looking for the
|
||||
* {@link TPM2ProvisionerState}
|
||||
* @param nonce the nonce to use as the key for the {@link TPM2ProvisionerState}
|
||||
* @return the {@link TPM2ProvisionerState} associated with the nonce;
|
||||
|
@ -464,8 +464,8 @@ public class IdentityClaimProcessor extends AbstractProcessor {
|
||||
if (baseRim != null) {
|
||||
// pull the base versions of the swidtag and rimel and set the
|
||||
// event log hash for use during provision
|
||||
SupportReferenceManifest sBaseRim = (SupportReferenceManifest) referenceManifestRepository
|
||||
.findByBase64Hash(baseRim.getBase64Hash());
|
||||
SupportReferenceManifest sBaseRim = referenceManifestRepository
|
||||
.getSupportRimEntityById(baseRim.getAssociatedRim());
|
||||
baseRim.setEventLogHash(temp.getHexDecHash());
|
||||
sBaseRim.setEventLogHash(temp.getHexDecHash());
|
||||
referenceManifestRepository.save(baseRim);
|
||||
|
@ -52,7 +52,7 @@ import java.util.Properties;
|
||||
@PropertySource(value = "classpath:hibernate.properties"),
|
||||
|
||||
// detects if file exists, if not, ignore errors
|
||||
@PropertySource(value = "file:/etc/hirs/aca/application.properties",
|
||||
@PropertySource(value = "file:/etc/hirs/aca/aca.properties",
|
||||
ignoreResourceNotFound = true)
|
||||
})
|
||||
@ComponentScan({"hirs.attestationca.portal", "hirs.attestationca.portal.page.controllers", "hirs.attestationca.persist", "hirs.attestationca.persist.entity", "hirs.attestationca.persist.service"})
|
||||
|
@ -228,6 +228,7 @@ public class CertificatePageController extends PageController<NoPageParams> {
|
||||
};
|
||||
|
||||
int currentPage = input.getStart() / input.getLength();
|
||||
int itemCount = 0;
|
||||
Pageable paging = PageRequest.of(currentPage, input.getLength(), Sort.by(orderColumnName));
|
||||
|
||||
// special parsing for platform credential
|
||||
@ -242,9 +243,10 @@ public class CertificatePageController extends PageController<NoPageParams> {
|
||||
org.springframework.data.domain.Page<PlatformCredential> pagedResult = this.platformCertificateRepository.findAll(paging);
|
||||
if (pagedResult.hasContent()) {
|
||||
records.addAll(pagedResult.getContent());
|
||||
itemCount = records.size();
|
||||
}
|
||||
records.setRecordsTotal(input.getLength());
|
||||
records.setRecordsFiltered(platformCertificateRepository.count());
|
||||
records.setRecordsTotal(platformCertificateRepository.count());
|
||||
records.setRecordsFiltered(itemCount);
|
||||
EndorsementCredential associatedEC;
|
||||
|
||||
if (!records.isEmpty()) {
|
||||
@ -274,10 +276,11 @@ public class CertificatePageController extends PageController<NoPageParams> {
|
||||
org.springframework.data.domain.Page<EndorsementCredential> pagedResult = this.endorsementCredentialRepository.findAll(paging);
|
||||
if (pagedResult.hasContent()) {
|
||||
records.addAll(pagedResult.getContent());
|
||||
itemCount = records.size();
|
||||
}
|
||||
|
||||
records.setRecordsTotal(input.getLength());
|
||||
records.setRecordsFiltered(endorsementCredentialRepository.count());
|
||||
records.setRecordsTotal(endorsementCredentialRepository.count());
|
||||
records.setRecordsFiltered(itemCount);
|
||||
|
||||
log.debug("Returning list of size: " + records.size());
|
||||
return new DataTableResponse<>(records, input);
|
||||
@ -290,9 +293,10 @@ public class CertificatePageController extends PageController<NoPageParams> {
|
||||
|
||||
if (pagedResult.hasContent()) {
|
||||
records.addAll(pagedResult.getContent());
|
||||
itemCount = records.size();
|
||||
}
|
||||
records.setRecordsTotal(input.getLength());
|
||||
records.setRecordsFiltered(caCredentialRepository.count());
|
||||
records.setRecordsTotal(caCredentialRepository.count());
|
||||
records.setRecordsFiltered(itemCount);
|
||||
|
||||
log.debug("Returning list of size: " + records.size());
|
||||
return new DataTableResponse<>(records, input);
|
||||
@ -301,9 +305,10 @@ public class CertificatePageController extends PageController<NoPageParams> {
|
||||
org.springframework.data.domain.Page<IssuedAttestationCertificate> pagedResult = this.issuedCertificateRepository.findAll(paging);
|
||||
if (pagedResult.hasContent()) {
|
||||
records.addAll(pagedResult.getContent());
|
||||
itemCount = records.size();
|
||||
}
|
||||
records.setRecordsTotal(input.getLength());
|
||||
records.setRecordsFiltered(issuedCertificateRepository.count());
|
||||
records.setRecordsTotal(issuedCertificateRepository.count());
|
||||
records.setRecordsFiltered(itemCount);
|
||||
|
||||
log.debug("Returning list of size: " + records.size());
|
||||
return new DataTableResponse<>(records, input);
|
||||
|
@ -96,8 +96,8 @@ public class DevicePageController extends PageController<NoPageParams> {
|
||||
if (pagedResult.hasContent()) {
|
||||
deviceList.addAll(pagedResult.getContent());
|
||||
}
|
||||
deviceList.setRecordsTotal(input.getLength());
|
||||
deviceList.setRecordsFiltered(deviceRepository.count());
|
||||
deviceList.setRecordsTotal(deviceRepository.count());
|
||||
deviceList.setRecordsFiltered(deviceList.size());
|
||||
|
||||
FilteredRecordsList<HashMap<String, Object>> records
|
||||
= retrieveDevicesAndAssociatedCertificates(deviceList);
|
||||
|
@ -119,6 +119,7 @@ public class ReferenceManifestPageController extends PageController<NoPageParams
|
||||
log.info("Querying with the following dataTableInput: " + input.toString());
|
||||
|
||||
FilteredRecordsList<ReferenceManifest> records = new FilteredRecordsList<>();
|
||||
int itemCount = 0;
|
||||
int currentPage = input.getStart() / input.getLength();
|
||||
Pageable paging = PageRequest.of(currentPage, input.getLength(), Sort.by(orderColumnName));
|
||||
org.springframework.data.domain.Page<ReferenceManifest> pagedResult = referenceManifestRepository.findAll(paging);
|
||||
@ -127,11 +128,12 @@ public class ReferenceManifestPageController extends PageController<NoPageParams
|
||||
for (ReferenceManifest manifest : pagedResult.getContent()) {
|
||||
if (!manifest.getRimType().equals(ReferenceManifest.MEASUREMENT_RIM)) {
|
||||
records.add(manifest);
|
||||
itemCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
records.setRecordsTotal(input.getLength());
|
||||
records.setRecordsFiltered(referenceManifestRepository.count());
|
||||
records.setRecordsTotal(referenceManifestRepository.count());
|
||||
records.setRecordsFiltered(itemCount);
|
||||
|
||||
log.debug("Returning list of size: " + records.size());
|
||||
return new DataTableResponse<>(records, input);
|
||||
|
@ -1,35 +0,0 @@
|
||||
package hirs.attestationca.portal.page.controllers;
|
||||
|
||||
/**
|
||||
* Restful implementation of the {@link }.
|
||||
* Exposes the ACA methods as REST endpoints.
|
||||
*/
|
||||
//@RestController
|
||||
//@RequestMapping("/")
|
||||
public class RestfulAttestationCertificateAuthority {
|
||||
// private final ReferenceManifestRepository referenceManifestRepository;
|
||||
// private final ReferenceDigestValueRepository referenceDigestValueRepository;
|
||||
//
|
||||
// @Autowired
|
||||
// public RestfulAttestationCertificateAuthority(
|
||||
// final ReferenceManifestRepository referenceManifestRepository,
|
||||
// final ReferenceDigestValueRepository referenceDigestValueRepository) {
|
||||
//
|
||||
// this.referenceManifestRepository = referenceManifestRepository;
|
||||
// this.referenceDigestValueRepository = referenceDigestValueRepository;
|
||||
//
|
||||
// }
|
||||
//
|
||||
//
|
||||
// @ResponseBody
|
||||
// @RequestMapping(value = "/upload-swidtag", method = RequestMethod.POST, consumes = MediaType.APPLICATION_OCTET_STREAM_VALUE)
|
||||
// public byte[] uploadSwidtag(@RequestBody final byte[] request) {
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// @ResponseBody
|
||||
// @RequestMapping(value = "/upload-rimel", method = RequestMethod.POST, consumes = MediaType.APPLICATION_OCTET_STREAM_VALUE)
|
||||
// public byte[] uploadRimel(@RequestBody final byte[] request) {
|
||||
// return null;
|
||||
// }
|
||||
}
|
@ -117,8 +117,8 @@ public class RimDatabasePageController extends PageController<NoPageParams> {
|
||||
if (pagedResult.hasContent()) {
|
||||
referenceDigestValues.addAll(pagedResult.getContent());
|
||||
}
|
||||
referenceDigestValues.setRecordsTotal(input.getLength());
|
||||
referenceDigestValues.setRecordsFiltered(referenceDigestValueRepository.count());
|
||||
referenceDigestValues.setRecordsTotal(referenceDigestValueRepository.count());
|
||||
referenceDigestValues.setRecordsFiltered(referenceDigestValues.size());
|
||||
|
||||
// FilteredRecordsList<ReferenceDigestValue> referenceDigestValues =
|
||||
// OrderedListQueryDataTableAdapter.getOrderedList(
|
||||
|
Loading…
x
Reference in New Issue
Block a user