All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pl.edu.icm.unity.restadm.web.console.RestAdminServiceEditor Maven / Gradle / Ivy

There is a newer version: 4.0.4
Show newest version
/*
 * Copyright (c) 2019 Bixbit - Krzysztof Benedyczak. All rights reserved.
 * See LICENCE.txt file for licensing information.
 */

package pl.edu.icm.unity.restadm.web.console;

import java.util.List;
import java.util.Set;

import io.imunity.vaadin.auth.services.DefaultServiceDefinition;
import io.imunity.vaadin.auth.services.ServiceDefinition;
import io.imunity.vaadin.auth.services.ServiceEditor;
import io.imunity.vaadin.auth.services.ServiceEditorComponent;
import io.imunity.vaadin.auth.services.tabs.AuthenticationTab;
import pl.edu.icm.unity.base.authn.AuthenticationFlowDefinition;
import pl.edu.icm.unity.base.message.MessageSource;
import pl.edu.icm.unity.engine.api.authn.AuthenticatorInfo;
import pl.edu.icm.unity.rest.jwt.endpoint.JWTManagementEndpoint;
import pl.edu.icm.unity.restadm.RESTAdminEndpoint;
import io.imunity.vaadin.endpoint.common.exceptions.FormValidationException;


/**
 * 
 * Rest admin service editor
 * 
 * @author P.Piernik
 *
 */
class RestAdminServiceEditor implements ServiceEditor
{
	private final MessageSource msg;
	private final List allRealms;
	private final List flows;
	private final List authenticators;
	private final List usedPaths;
	private final List usedNames;
	private final Set serverContextPaths;
	private RestAdminServiceEditorComponent editor;

	RestAdminServiceEditor(MessageSource msg, List allRealms, List flows,
			List authenticators, List usedPaths, List usedNames,  Set serverContextPaths)
	{
		this.msg = msg;
		this.allRealms = allRealms;
		this.authenticators = authenticators;
		this.flows = flows;
		this.usedPaths = usedPaths;
		this.usedNames = usedNames;
		this.serverContextPaths = serverContextPaths;
	}

	@Override
	public ServiceEditorComponent getEditor(ServiceDefinition endpoint)
	{

		RestAdminServiceEditorGeneralTab restAdminServiceEditorGeneralTab = new RestAdminServiceEditorGeneralTab(
				msg, RESTAdminEndpoint.TYPE, usedPaths, usedNames, serverContextPaths);

		AuthenticationTab authenticationTab = new AuthenticationTab(msg, flows, authenticators, allRealms,
				JWTManagementEndpoint.TYPE.getSupportedBinding());

		editor = new RestAdminServiceEditorComponent(msg, restAdminServiceEditorGeneralTab, authenticationTab,
				(DefaultServiceDefinition) endpoint);
		return editor;
	}

	@Override
	public ServiceDefinition getEndpointDefiniton() throws FormValidationException
	{
		return editor.getServiceDefiniton();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy