Skip to content
This repository has been archived by the owner on Mar 15, 2022. It is now read-only.

HAL-1363 - Add new log elytron resources #438

Merged
merged 1 commit into from
Jun 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ void initSSL(
List<Property> clientSSLContext,
List<Property> trustManager,
List<Property> securityDomain,
List<Property> securityProperty,
List<Property> providerLoader,
List<Property> aggregateProvidersModel);

Expand All @@ -76,7 +75,8 @@ void initDirContext(

void initLogs(
List<Property> file,
List<Property> rotating,
List<Property> sizeRotatingFile,
List<Property> periodicRotatingFile,
List<Property> syslog
);

Expand Down Expand Up @@ -127,7 +127,6 @@ protected void onAction(Action action) {
store.getClientSSLContext(),
store.getTrustManager(),
store.getSecurityDomain(),
store.getSecurityProperty(),
store.getProviderLoader(),
store.getAggregateProviders());

Expand All @@ -137,7 +136,8 @@ protected void onAction(Action action) {

getView().initLogs(
store.getFileAuditLog(),
store.getRotatingFileAuditLog(),
store.getSizeRotatingFileAuditLog(),
store.getPeriodicRotatingFileAuditLog(),
store.getSyslogAuditLog()
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ public void onFailure(final AddressTemplate address, final String name, final Th
public static final AddressTemplate SIMPLE_ROLE_DECODER_ADDRESS = AddressTemplate.of(ROOT).append("simple-role-decoder=*");

public static final AddressTemplate SECURITY_DOMAIN_ADDRESS = AddressTemplate.of(ROOT).append("security-domain=*");
public static final AddressTemplate SECURITY_PROPERTY_ADDRESS = AddressTemplate.of(ROOT).append("security-property=*");

public static final AddressTemplate DIR_CONTEXT_ADDRESS = AddressTemplate.of(ROOT).append("dir-context=*");
public static final AddressTemplate AUTHENTICATION_CONTEXT_ADDRESS = AddressTemplate.of(ROOT).append("authentication-context=*");
Expand All @@ -149,8 +148,9 @@ public void onFailure(final AddressTemplate address, final String name, final Th
public static final AddressTemplate AGGREGATE_SECURITY_EVENT_LISTENER_ADDRESS = AddressTemplate.of(ROOT).append("aggregate-security-event-listener=*");
public static final AddressTemplate FILE_AUDIT_LOG_ADDRESS = AddressTemplate.of(ROOT).append("file-audit-log=*");
public static final AddressTemplate POLICY_ADDRESS = AddressTemplate.of(ROOT).append("policy=*");
public static final AddressTemplate ROTATING_FILE_AUDIT_ADDRESS = AddressTemplate.of(ROOT).append("rotating-file-audit-log=*");
public static final AddressTemplate SYSLOG_AUDIT_LOG_ADDRESS = AddressTemplate.of(ROOT).append("syslog-audit-log=*");
public static final AddressTemplate SIZE_ROTATING_FILE_AUDIT_ADDRESS = AddressTemplate.of(ROOT).append("size-rotating-file-audit-log=*");
public static final AddressTemplate PERIODIC_ROTATING_FILE_AUDIT_ADDRESS = AddressTemplate.of(ROOT).append("periodic-rotating-file-audit-log=*");


private final DispatchAsync dispatcher;
Expand Down Expand Up @@ -228,16 +228,16 @@ public void onFailure(final AddressTemplate address, final String name, final Th
private final List<Property> simpleRoleDecoder;

private final List<Property> securityDomain;
private final List<Property> securityProperty;
private final List<Property> dirContext;
private final List<Property> authenticationContext;
private final List<Property> authenticationconfiguration;

private final List<Property> aggregateSecurityEventListener;
private final List<Property> fileAuditLog;
private final List<Property> policy;
private final List<Property> rotatingFileAuditLog;
private final List<Property> syslogAuditLog;
private final List<Property> sizeRotatingFileAuditLog;
private final List<Property> periodicRotatingFileAuditLog;


@Inject
Expand Down Expand Up @@ -316,7 +316,6 @@ public ElytronStore(final DispatchAsync dispatcher, StatementContext statementCo
simpleRoleDecoder = new ArrayList<>();

securityDomain = new ArrayList<>();
securityProperty = new ArrayList<>();

dirContext = new ArrayList<>();
authenticationContext = new ArrayList<>();
Expand All @@ -325,8 +324,9 @@ public ElytronStore(final DispatchAsync dispatcher, StatementContext statementCo
aggregateSecurityEventListener = new ArrayList<>();
fileAuditLog = new ArrayList<>();
policy = new ArrayList<>();
rotatingFileAuditLog = new ArrayList<>();
syslogAuditLog = new ArrayList<>();
sizeRotatingFileAuditLog = new ArrayList<>();
periodicRotatingFileAuditLog = new ArrayList<>();
}


Expand Down Expand Up @@ -369,7 +369,6 @@ public void onSuccess(final DMRResponse response) {
populate(payload, "provider-loader", providerLoader);
populate(payload, "aggregate-providers", aggregateProviders);
populate(payload, "security-domain", securityDomain);
populate(payload, "security-property", securityProperty);

populate(payload, "aggregate-principal-transformer", aggregatePrincipalTransformer);
populate(payload, "chained-principal-transformer", chainedPrincipalTransformer);
Expand All @@ -381,8 +380,9 @@ public void onSuccess(final DMRResponse response) {
populate(payload, "aggregate-security-event-listener", aggregateSecurityEventListener);
populate(payload, "file-audit-log", fileAuditLog);
populate(payload, "policy", policy);
populate(payload, "rotating-file-audit-log", rotatingFileAuditLog);
populate(payload, "syslog-audit-log", syslogAuditLog);
populate(payload, "size-rotating-file-audit-log", sizeRotatingFileAuditLog);
populate(payload, "periodic-rotating-file-audit-log", periodicRotatingFileAuditLog);

populate(payload, "dir-context", dirContext);

Expand Down Expand Up @@ -802,10 +802,6 @@ public List<Property> getSecurityDomain() {
return securityDomain;
}

public List<Property> getSecurityProperty() {
return securityProperty;
}

public List<Property> getDirContext() {
return dirContext;
}
Expand Down Expand Up @@ -842,8 +838,12 @@ public List<Property> getPolicy() {
return policy;
}

public List<Property> getRotatingFileAuditLog() {
return rotatingFileAuditLog;
public List<Property> getSizeRotatingFileAuditLog() {
return sizeRotatingFileAuditLog;
}

public List<Property> getPeriodicRotatingFileAuditLog() {
return periodicRotatingFileAuditLog;
}

public List<Property> getSyslogAuditLog() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public Widget createWidget() {
public void initSSL(final List<Property> keyStore, List<Property> credentialStore,
List<Property> filteringKeyStore, List<Property> ldapKeyStore, List<Property> keyManager,
List<Property> serverSSLContext, List<Property> clientSSLContext, List<Property> trustManager,
List<Property> securityDomainModel, List<Property> securityPropertyModel, List<Property> providerLoaderModel,
List<Property> securityDomainModel, List<Property> providerLoaderModel,
List<Property> aggregateProvidersModel) {
sslView.updateKeyStore(keyStore);
sslView.updateCredentialStore(credentialStore);
Expand All @@ -92,7 +92,6 @@ public void initSSL(final List<Property> keyStore, List<Property> credentialStor
sslView.updateClientSSLContext(clientSSLContext);
sslView.updateTrustManager(trustManager);
sslView.updateSecurityDomain(securityDomainModel);
sslView.updateSecurityProperty(securityPropertyModel);
sslView.updateProviderLoader(providerLoaderModel);
sslView.updateAggregateProviders(aggregateProvidersModel);
}
Expand All @@ -103,9 +102,11 @@ public void initDirContext(final List<Property> dirContextModels) {
}

@Override
public void initLogs(final List<Property> file, final List<Property> rotating, final List<Property> syslog) {
public void initLogs(final List<Property> file, final List<Property> size, final List<Property> periodic,
final List<Property> syslog) {
logsView.updateFileAuditLogView(file);
logsView.updateRotatingAuditLogView(rotating);
logsView.updateSizeRotatingAuditLogView(size);
logsView.updatePeriodicRotatingAuditLogView(periodic);
logsView.updateSyslogAuditLogView(syslog);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ public class LogsView {
private SecurityContext securityContext;

private ElytronGenericResourceView fileAuditLogView;
private ElytronGenericResourceView rotatingAuditLogView;
private ElytronGenericResourceView sizeRotatingAuditLogView;
private ElytronGenericResourceView periodicRotatingAuditLogView;
private ElytronGenericResourceView syslogAuditLogView;

public LogsView(final Dispatcher circuit, final ResourceDescription rootDescription,
Expand All @@ -48,22 +49,27 @@ public LogsView(final Dispatcher circuit, final ResourceDescription rootDescript
public Widget asWidget() {

ResourceDescription fileDescription = rootDescription.getChildDescription("file-audit-log");
ResourceDescription rotatingDescription = rootDescription.getChildDescription("rotating-file-audit-log");
ResourceDescription sizeRotatingDescription = rootDescription.getChildDescription("size-rotating-file-audit-log");
ResourceDescription periodicRotatingDescription = rootDescription.getChildDescription("periodic-rotating-file-audit-log");
ResourceDescription syslogDescription = rootDescription.getChildDescription("syslog-audit-log");

fileAuditLogView = new ElytronGenericResourceView(circuit, fileDescription, securityContext, "File Audit Log",
ElytronStore.FILE_AUDIT_LOG_ADDRESS);

rotatingAuditLogView = new ElytronGenericResourceView(circuit, rotatingDescription, securityContext, "Rotating File Audit Log",
ElytronStore.ROTATING_FILE_AUDIT_ADDRESS);
sizeRotatingAuditLogView = new ElytronGenericResourceView(circuit, sizeRotatingDescription, securityContext,
"File Size Rotating Audit Log", ElytronStore.SIZE_ROTATING_FILE_AUDIT_ADDRESS);

periodicRotatingAuditLogView = new ElytronGenericResourceView(circuit, periodicRotatingDescription, securityContext,
"File Periodic Rotating Audit Log", ElytronStore.PERIODIC_ROTATING_FILE_AUDIT_ADDRESS);

syslogAuditLogView = new ElytronGenericResourceView(circuit, syslogDescription, securityContext, "Syslog Audit Log",
ElytronStore.SYSLOG_AUDIT_LOG_ADDRESS);


PagedView panel = new PagedView(true);
panel.addPage("File Audit Log", fileAuditLogView.asWidget());
panel.addPage("Rotating File Audit Log", rotatingAuditLogView.asWidget());
panel.addPage("File Size Rotating Audit Log", sizeRotatingAuditLogView.asWidget());
panel.addPage("File Periodic Rotating Audit Log", periodicRotatingAuditLogView.asWidget());
panel.addPage("Syslog Audit Log", syslogAuditLogView.asWidget());
// default page
panel.showPage(0);
Expand All @@ -75,8 +81,12 @@ public void updateFileAuditLogView(final List<Property> model) {
this.fileAuditLogView.update(model);
}

public void updateRotatingAuditLogView(final List<Property> model) {
this.rotatingAuditLogView.update(model);
public void updatePeriodicRotatingAuditLogView(final List<Property> model) {
this.periodicRotatingAuditLogView.update(model);
}

public void updateSizeRotatingAuditLogView(final List<Property> model) {
this.sizeRotatingAuditLogView.update(model);
}

public void updateSyslogAuditLogView(final List<Property> model) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public class SSLView {
private ElytronGenericResourceView clientSSLContextView;
private TrustManagerView trustManagerView;
private SecurityDomainView securityDomainView;
private ElytronGenericResourceView securityPropertyView;
private ElytronGenericResourceView providerLoaderView;
private ElytronGenericResourceView aggregateProvidersView;

Expand All @@ -65,7 +64,6 @@ public Widget asWidget() {
ResourceDescription clientSSLContextDescription = rootDescription.getChildDescription("client-ssl-context");
ResourceDescription trustManagersDescription = rootDescription.getChildDescription("trust-manager");
ResourceDescription securityDomainDescription = rootDescription.getChildDescription("security-domain");
ResourceDescription securityPropertyDescription = rootDescription.getChildDescription("security-property");
ResourceDescription providerLoaderDescription = rootDescription.getChildDescription("provider-loader");
ResourceDescription aggregateProvidersDescription = rootDescription.getChildDescription("aggregate-providers");

Expand Down Expand Up @@ -96,9 +94,6 @@ public Widget asWidget() {
securityDomainView = new SecurityDomainView(circuit, securityDomainDescription, securityContext,
"Security Domain", ElytronStore.SECURITY_DOMAIN_ADDRESS);

securityPropertyView = new ElytronGenericResourceView(circuit, securityPropertyDescription, securityContext,
"Security Property", ElytronStore.SECURITY_PROPERTY_ADDRESS);

providerLoaderView = new ElytronGenericResourceView(circuit, providerLoaderDescription, securityContext,
"Provider Loader", ElytronStore.PROVIDER_LOADER_ADDRESS);

Expand All @@ -115,7 +110,6 @@ public Widget asWidget() {
panel.addPage("Client SSL Context", clientSSLContextView.asWidget());
panel.addPage("Trust Manager", trustManagerView.asWidget());
panel.addPage("Security Domain", securityDomainView.asWidget());
panel.addPage("Security Property", securityPropertyView.asWidget());
panel.addPage("Provider Loader", providerLoaderView.asWidget());
panel.addPage("Aggregate Providers", aggregateProvidersView.asWidget());
// default page
Expand Down Expand Up @@ -160,10 +154,6 @@ public void updateSecurityDomain(List<Property> models) {
securityDomainView.update(models);
}

public void updateSecurityProperty(List<Property> models) {
securityPropertyView.update(models);
}

public void updateProviderLoader(List<Property> models) {
providerLoaderView.update(models);
}
Expand Down