<commit_before>/*
 * Copyright (c) 2008-2016 Haulmont.
 *
 * 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 com.haulmont.idp;

import com.haulmont.cuba.core.config.Config;
import com.haulmont.cuba.core.config.Property;
import com.haulmont.cuba.core.config.Source;
import com.haulmont.cuba.core.config.SourceType;
import com.haulmont.cuba.core.config.defaults.DefaultBoolean;
import com.haulmont.cuba.core.config.defaults.DefaultInt;
import com.haulmont.cuba.core.config.type.CommaSeparatedStringListTypeFactory;
import com.haulmont.cuba.core.config.type.Factory;

import java.util.List;

/**
 * Configuration interface for IDP web service.
 */
@Source(type = SourceType.APP)
public interface IdpConfig extends Config {
    /**
     * @return trusted password of middleware
     */
    @Property("cuba.trustedClientPassword")
    String getTrustedClientPassword();

    /**
     * @return trusted password to grant access to services, must be equal to cuba.web.idp.trustedServicePassword on service
     */
    @Property("cuba.idp.trustedServicePassword")
    String getTrustedServicePassword();

    /**
     * @return all permitted service URLs. <br/>
     *         IDP is allowed to send redirects only on these URLs. <br/>
     *         First URL is used as default if user opened IDP login form directly.
     */
    @Property("cuba.idp.serviceProviderUrls")
    @Factory(factory = CommaSeparatedStringListTypeFactory.class)
    List<String> getServiceProviderUrls();

    /**
     * @return all URLs that need to be notified on session logout or expiration. <br/>
     *         For example in CUBA it is http://localhost:8080/app/dispatch/idpc/logout. <br/>
     *         IDP will pass to POST request two form-urlencoded parameters with names idpSessionId and trustedServicePassword.
     */
    @Property("cuba.idp.serviceProviderLogoutUrls")
    @Factory(factory = CommaSeparatedStringListTypeFactory.class)
    List<String> getServiceProviderLogoutUrls();

    /**
     * @return service provider ticket expiration timeout in seconds.
     */
    @Property("cuba.idp.ticketExpirationTimeoutSec")
    @DefaultInt(180)
    int getTicketExpirationTimeoutSec();

    /**
     * @return IDP session expiration timeout in seconds.
     */
    @Property("cuba.idp.sessionExpirationTimeoutSec")<commit_msg>PL-5085 Single sign-on for CUBA applications - JavaDoc for IdpConfig properties<commit_after>/*
 * Copyright (c) 2008-2016 Haulmont.
 *
 * 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 com.haulmont.idp;

import com.haulmont.cuba.core.config.Config;
import com.haulmont.cuba.core.config.Property;
import com.haulmont.cuba.core.config.Source;
import com.haulmont.cuba.core.config.SourceType;
import com.haulmont.cuba.core.config.defaults.DefaultBoolean;
import com.haulmont.cuba.core.config.defaults.DefaultInt;
import com.haulmont.cuba.core.config.type.CommaSeparatedStringListTypeFactory;
import com.haulmont.cuba.core.config.type.Factory;

import java.util.List;

/**
 * Configuration interface for IDP web service.
 */
@Source(type = SourceType.APP)
public interface IdpConfig extends Config {
    /**
     * @return trusted password of middleware
     */
    @Property("cuba.trustedClientPassword")
    String getTrustedClientPassword();

    /**
     * @return trusted password to grant access to services, must be equal to cuba.web.idp.trustedServicePassword on service
     */
    @Property("cuba.idp.trustedServicePassword")
    String getTrustedServicePassword();

    /**
     * @return all permitted service URLs separated by comma. <br/>
     *         IDP is allowed to send redirects only on these URLs. <br/>
     *         First URL is used as default if user opened IDP login form directly.
     */
    @Property("cuba.idp.serviceProviderUrls")
    @Factory(factory = CommaSeparatedStringListTypeFactory.class)
    List<String> getServiceProviderUrls();

    /**
     * @return all URLs that need to be notified on session logout or expiration separated by comma. <br/>
     *         For example in CUBA it is http://localhost:8080/app/dispatch/idpc/logout. <br/>
     *         IDP will pass to POST request two form-urlencoded parameters with names idpSessionId and trustedServicePassword.
     */
    @Property("cuba.idp.serviceProviderLogoutUrls")
    @Factory(factory = CommaSeparatedStringListTypeFactory.class)
    List<String> getServiceProviderLogoutUrls();

    /**
     * @return service provider ticket expiration timeout in seconds.
     */
    @Property("cuba.idp.ticketExpirationTimeoutSec")
    @DefaultInt(180)
    int getTicketExpirationTimeoutSec();

    /**
     * @return IDP session expiration timeout in seconds.
     */
    @Property("cuba.idp.sessionExpirationTimeoutSec")
{'fraction_non_alphanumeric': 0.09458521346754599, 'fraction_numerical': 0.007289135716765012, 'mean_word_length': 3.603035143769968, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3218265', 'n_tokens_mistral': 1687, 'n_tokens_neox': 1601, 'n_words': 490}