package com.qmth.boot.core.security.service;

import com.qmth.boot.tools.signature.SignatureType;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 鉴权服务注册服务
 */
public interface AuthorizationServiceRegistration {

    /**
     * 按访问路径前缀与签名类型设置鉴权服务
     *
     * @param prefix
     * @param service
     * @return
     */
    AuthorizationServiceRegistration setPrefix(@NotBlank String prefix, @NotNull AuthorizationService service);

    /**
     * 按访问路径前缀设置鉴权服务，不限制签名类型
     *
     * @param prefix
     * @param type
     * @param service
     * @return
     */
    AuthorizationServiceRegistration setPrefix(@NotBlank String prefix, @NotNull SignatureType type,
            @NotNull AuthorizationService service);

    /**
     * 按签名类型设置默认鉴权服务
     *
     * @param type
     * @param service
     * @return
     */
    AuthorizationServiceRegistration setDefault(@NotNull SignatureType type, @NotNull AuthorizationService service);

    /**
     * 设置默认鉴权服务，不限制签名类型
     *
     * @param service
     * @return
     */
    AuthorizationServiceRegistration setDefault(@NotNull AuthorizationService service);

}
