Skip to content
This repository was archived by the owner on Mar 15, 2022. It is now read-only.
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class='preview-content'>
<h1>Security Realm</h1>
Elytron settings for security realms.
Elytron settings for security realms and authentication.
</div>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class='preview-content'>
<h1>Security Realm</h1>
Elytron settings for security realms.
Elytron settings for security realms and authentication.
</div>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class='preview-content'>
<h1>Security Realm</h1>
Elytron settings for security realms.
Elytron settings for security realms and authentication.
</div>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class='preview-content'>
<h1>Security Realm</h1>
Elytron settings for security realms.
Elytron settings for security realms and authentication.
</div>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class='preview-content'>
<h1>Security Realm</h1>
Elytron settings for security realms.
Elytron settings for security realms and authentication.
</div>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class='preview-content'>
<h1>Security Realm</h1>
Elytron settings for security realms.
Elytron settings for security realms and authentication.
</div>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class='preview-content'>
<h1>Security Realm</h1>
Elytron settings for security realms.
Elytron settings for security realms and authentication.
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class ElytronFinderView extends SuspendableViewImpl implements ElytronFin

public static final String FACTORY = "Factory";
public static final String MAPPER_DECODER = "Mapper / Decoder";
public static final String SECURITY_REALM = "Security Realm";
public static final String SECURITY_REALM = "Security Realm / Authentication";
public static final String OTHER = "Other";

private ElytronFinder presenter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ void initSecurityRealm(
List<Property> mappedRegexRealmMapper,
List<Property> simpleRegexRealmMapper,
List<Property> customRealmMapper,
List<Property> constantRealmMapper);
List<Property> constantRealmMapper,
List<Property> authContext,
List<Property> authConfiguration);

}
// @formatter:on
Expand Down Expand Up @@ -122,7 +124,9 @@ protected void onAction(Action action) {
store.getMappedRegexRealmMapper(),
store.getSimpleRegexRealmMapper(),
store.getCustomRealmMapper(),
store.getConstantRealmMapper());
store.getConstantRealmMapper(),
store.getAuthenticationContext(),
store.getAuthenticationconfiguration());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ public void onFailure(final AddressTemplate address, final String name, final Th
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=*");
public static final AddressTemplate AUTHENTICATION_CONF_ADDRESS = AddressTemplate.of(ROOT).append("authentication-configuration=*");

private final DispatchAsync dispatcher;
private final StatementContext statementContext;
Expand Down Expand Up @@ -217,6 +219,8 @@ public void onFailure(final AddressTemplate address, final String name, final Th
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;

@Inject
public ElytronStore(final DispatchAsync dispatcher, StatementContext statementContext) {
Expand Down Expand Up @@ -295,6 +299,8 @@ public ElytronStore(final DispatchAsync dispatcher, StatementContext statementCo
securityProperty = new ArrayList<>();

dirContext = new ArrayList<>();
authenticationContext = new ArrayList<>();
authenticationconfiguration = new ArrayList<>();
}


Expand Down Expand Up @@ -397,6 +403,8 @@ public void onSuccess(final DMRResponse response) {
populate(payload, "security-property", securityProperty);

populate(payload, "dir-context", dirContext);
populate(payload, "authentication-context", authenticationContext);
populate(payload, "authentication-configuration", authenticationconfiguration);

channel.ack();
}
Expand Down Expand Up @@ -743,4 +751,12 @@ public List<Property> getDirContext() {
public List<Property> getProviderLoader() {
return providerLoader;
}

public List<Property> getAuthenticationContext() {
return authenticationContext;
}

public List<Property> getAuthenticationconfiguration() {
return authenticationconfiguration;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
/*
* Copyright 2015-2016 Red Hat, Inc, and individual contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.as.console.client.shared.subsys.elytron.ui;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.google.gwt.user.client.ui.Widget;
import org.jboss.as.console.client.shared.subsys.elytron.store.ElytronStore;
import org.jboss.as.console.client.shared.subsys.elytron.store.ModifyComplexAttribute;
import org.jboss.as.console.client.v3.dmr.AddressTemplate;
import org.jboss.as.console.client.v3.dmr.ResourceDescription;
import org.jboss.as.console.mbui.widgets.ComplexAttributeForm;
import org.jboss.as.console.mbui.widgets.ModelNodeFormBuilder;
import org.jboss.ballroom.client.rbac.SecurityContext;
import org.jboss.ballroom.client.widgets.forms.FormCallback;
import org.jboss.dmr.client.Property;
import org.jboss.gwt.circuit.Dispatcher;

/**
* @author Claudio Miranda <claudio@redhat.com>
*/
public class AuthenticationConfigurationView extends ElytronGenericResourceView {

public static final String COMPLEX_ATTRIBUTE = "credential-reference";
private ModelNodeFormBuilder.FormAssets credentialReferenceFormAsset;

public AuthenticationConfigurationView(final Dispatcher circuit,
final ResourceDescription resourceDescription,
final SecurityContext securityContext, final String title,
final AddressTemplate addressTemplate) {
super(circuit, resourceDescription, securityContext, title, addressTemplate);
excludesFormAttributes(COMPLEX_ATTRIBUTE);
}

@Override
public Map<String, Widget> additionalTabDetails() {
Map<String, Widget> additionalWidgets = new HashMap<>();
credentialReferenceFormAsset = new ComplexAttributeForm(COMPLEX_ATTRIBUTE, securityContext, resourceDescription).build();

credentialReferenceFormAsset.getForm().setToolsCallback(new FormCallback() {
@Override
@SuppressWarnings("unchecked")
public void onSave(final Map changeset) {
circuit.dispatch(new ModifyComplexAttribute(ElytronStore.AUTHENTICATION_CONF_ADDRESS, COMPLEX_ATTRIBUTE,
selectionModel.getSelectedObject().getName(), credentialReferenceFormAsset.getForm().getUpdatedEntity()));
}

@Override
public void onCancel(final Object entity) {
credentialReferenceFormAsset.getForm().cancel();
}
});

additionalWidgets.put("Credential Reference", credentialReferenceFormAsset.asWidget());
return additionalWidgets;
}

@Override
public void update(final List<Property> models) {
super.update(models);
if (models.isEmpty()) {
credentialReferenceFormAsset.getForm().clearValues();
}
}

@Override
protected void selectTableItem(final Property prop) {
if (prop != null) {
credentialReferenceFormAsset.getForm().edit(prop.getValue().get(COMPLEX_ATTRIBUTE));
} else {
credentialReferenceFormAsset.getForm().clearValues();
}
}

}
Loading