mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-12 04:27:39 +00:00
(improvement)(headless) Query metric/dimension by id in SchemaController and update api header check (#608)
* (improvement)(headless) Query metric/dimension by id in SchemaController and update api header check * (improvement)(headless) Fix the issue where metrics were not recognized when the result field contained an aggregate function. --------- Co-authored-by: jolunoluo
This commit is contained in:
@@ -24,4 +24,13 @@ public class AuthenticationConfig {
|
||||
@Value("${authentication.token.http.header.key:Authorization}")
|
||||
private String tokenHttpHeaderKey;
|
||||
|
||||
@Value("${authentication.app.appId:appId}")
|
||||
private String appId;
|
||||
|
||||
@Value("${authentication.app.timestamp:timestamp}")
|
||||
private String timestamp;
|
||||
|
||||
@Value("${authentication.app.signature:signature}")
|
||||
private String signature;
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,11 @@ package com.tencent.supersonic.auth.api.authentication.utils;
|
||||
|
||||
import com.tencent.supersonic.auth.api.authentication.pojo.User;
|
||||
import com.tencent.supersonic.auth.api.authentication.service.UserStrategy;
|
||||
import com.tencent.supersonic.common.pojo.SysParameter;
|
||||
import com.tencent.supersonic.common.service.SysParameterService;
|
||||
import com.tencent.supersonic.common.util.ContextUtils;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@@ -14,7 +19,14 @@ public final class UserHolder {
|
||||
}
|
||||
|
||||
public static User findUser(HttpServletRequest request, HttpServletResponse response) {
|
||||
return REPO.findUser(request, response);
|
||||
User user = REPO.findUser(request, response);
|
||||
SysParameterService sysParameterService = ContextUtils.getBean(SysParameterService.class);
|
||||
SysParameter sysParameter = sysParameterService.getSysParameter();
|
||||
if (!CollectionUtils.isEmpty(sysParameter.getAdmins())
|
||||
&& sysParameter.getAdmins().contains(user.getName())) {
|
||||
user.setIsAdmin(1);
|
||||
}
|
||||
return user;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user