Skip to content

配置

所有的配置都在这里,当需要再来查看,后面也会提及

基础配置

配置项说明类型默认值
authz.appapp名,避免在同一cache中启动多Authz服务导致的数据混乱StringdefaultApp
authz.banner是否打印bannerbooleantrue
authz.logauthz的日志等级LogLevel [ DEBUG, INFO, WARN, ERROR, OFF ]WARN
authz.default-decryptor使用@Decrypt时的默认的解密器Class<? extends Decryptor>RSADecryptor.class
authz.ormorm框架 目前仅支持mybatis,数据权限启用ORM

Token配置

查看具体使用

配置项说明类型默认值
authz.token.key签名的私钥,若长度不够将自动以.填充,若为空,将不执行数字签名String
authz.token.token-id-bits登录标识的长度int8
authz.token.cookie-namecookie nameStringatkn
authz.token.header-nameheader nameStringauthorization
authz.token.header-prefixprefix 例如:headerPrefix = 'Bearer' -> "Bearer " headerPrefix不需要在最后空格,但是在请求时需要空一格StringBearer
authz.token.access-timeaccess token有效时间,默认 7d ,单位 msString7d
authz.token.refresh-timerefresh token有效时间,默认 30d ,单位 msString30d
authz.token.logout-before-login在登录前退出,若某请求为申请登录的请求,并且此请求已经登录,那么会将之前的登录移除booleantrue
authz.token.bind-iptoken是否绑定登录的ip。若请求ip与token绑定的ip不相同,token会立即失效booleanfalse

Cache配置

配置项说明类型默认值
authz.cache.enable-redis是否开启redis缓存(双层同步缓存)booleanfalse
authz.cache.enable-redis-actuator是否开启redis健康监控检查,默认关闭booleanfalse
authz.cache.redis-can-countredis每次扫描key的数量int10000
authz.cache.cache-maximum-size最大缓存数,不配置时默认无大小限制int
authz.cache.expire-after-create-time在【创建】之后L2Cache存活时间 默认10分钟 单位 ms |s |m |h |dString10m
authz.cache.expire-after-update-time在【更新】之后L2Cache存活时间 默认10分钟 单位 ms |s |m |h |dString10m
authz.cache.expire-after-read-time在【读取】之后L2Cache存活时间 默认10分钟 单位 ms |s |m |h |dString10m

UserDevice配置

查看具体使用

配置项说明类型默认值
authz.user.maximum-total-device登录设备总数默不做限制【-1为不做限制,最小为1】,超出会挤出最长时间未访问的设备。int-1
authz.user.maximum-total-same-type-device相当于typesTotal对所有的类型添加一个设备数量限制,会被typesTotal覆盖。 同类型设备最大登录数 默认不做限制(1.2.7之前为限制1个)【-1为不做限制,最小为1】,超出会挤出最长时间未访问的设备。int1
authz.user.types-total每[一种、多种]设备类型设置[共同]的最大登录数(最小为1),超出会挤出最长时间未访问的设备。List<DeviceCountInfo>new ArrayList<>()

Dashboard配置

查看具体使用

配置项说明类型默认值
authz.dashboard.enabled是否开启dashboardbooleanfalse
authz.dashboard..users登录用户,可与username,password共用List<User> User:username,password,DashboardPermission[]new ArrayList<>()
authz.dashboard..username用户名Stringauthz
authz.dashboard.password用户密码Stringauthz
authz.dashboard.permissions用户拥有的权限,默认为所有,可以设置为API(只能修改API的权限)、PARAMETER(只能修改参数的权限)DashboardPermission:[API, PARAMETER, DATA_COL, DATA_ROW, RATE, BLACKLIST, OPEN_AUTH, LOGIN, DOCS, REQUEST, ALL]ALL
authz.dashboard.unresponsive-expiration-time未响应过期时间 默认10分钟 单位 ms |s |m |h |dString10m
authz.dashboard.allow【只允许】的iprange 格式: xx.xx.xx.xx/xx , xx.xx.xx.xx/xxString
authz.dashboard.deny拒绝的iprange 格式: xx.xx.xx.xx/xx , xx.xx.xx.xx/xxString

OpenAuth2.0配置

配置项说明类型默认值
authz.oauth.authorization-code-time授权码过期时间String10m
authz.oauth.default-basic-scope默认授予的权限。 通过oauth授权登录的用户拥有的权限,@OAuthScopeBasic标识之后的额外scope 通过正常登录的用户不受scope的影响,能访问所有资源Stringbasic
authz.oauth.scope-separatorscope分割符 默认空格String
authz.oauth.clientId-length客户端Id长度 默认24int24
authz.oauth.client-secret-length客户端密钥长度 默认30位int30
authz.oauth.algorithm授权码签名算法AuthorizationCodeAlgorithm [SHA_256,SHA1,MD5]SHA1

全局IpRange配置

配置项说明类型默认值
authz.global-ip-range.allow若配置,则必须在这些范围内 xx.xx.xx.xx/xx , xx.xx.xx.xx/xxString
authz.global-ip-range.deny拒绝访问网段 xx.xx.xx.xx/xx , xx.xx.xx.xx/xxString
authz.global-ip-range.support-native0:0:0:0:0:0:0:1 127.0.0.1是否支持booleantrue

RSA配置

配置项说明类型默认值
authz.rsa.auto是否开启自动刷新RSAbooleantrue
authz.rsa.rsaKeyRefreshWithPeriodauto为true时生效 rsa的key刷新时间 单位 ms |s |m |h |dString7d
authz.rsa.customPublicKey自定义公钥String
authz.rsa.custom-private-key自定义私钥String

默认Response配置

配置项说明类型默认值
authz.response.always-ok返回体状态码是否永远为200、不论是否出错(默认错误拦截器情况下)booleanfalse

其他配置

配置项说明类型默认值
authz.sys.gc-period定期GC时间,为0或为空则关闭 单位 ms |s |m |h |d
authz.sys.md5checkjar包md5检查booleanfalse

qq群: 115222346