mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-15 06:27:21 +00:00
[improvement][project] global refactor , code format , support llm , support fuzzy detect ,support query filter and so on.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.tencent.supersonic</groupId>
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.tencent.supersonic.auth.api.authorization.pojo;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AuthGroup {
|
||||
|
||||
private String domainId;
|
||||
private String name;
|
||||
private Integer groupId;
|
||||
private List<AuthRule> authRules;
|
||||
/**
|
||||
* row permission expression
|
||||
*/
|
||||
private List<String> dimensionFilters;
|
||||
/**
|
||||
* row permission expression description information
|
||||
*/
|
||||
private String dimensionFilterDescription;
|
||||
|
||||
private List<String> authorizedUsers;
|
||||
/**
|
||||
* authorization Department Id
|
||||
*/
|
||||
private List<String> authorizedDepartmentIds;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.tencent.supersonic.auth.api.authorization.pojo;
|
||||
|
||||
import java.beans.Transient;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AuthRule {
|
||||
|
||||
private String name;
|
||||
private String description;
|
||||
private List<String> metrics;
|
||||
private List<String> dimensions;
|
||||
|
||||
@Transient
|
||||
public List<String> resourceNames() {
|
||||
ArrayList<String> res = new ArrayList<>();
|
||||
if (metrics != null) {
|
||||
res.addAll(metrics);
|
||||
}
|
||||
|
||||
if (dimensions != null) {
|
||||
res.addAll(dimensions);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.tencent.supersonic.auth.api.authorization.request;
|
||||
|
||||
import com.tencent.supersonic.auth.api.authorization.pojo.AuthRes;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
@@ -11,6 +12,10 @@ import lombok.ToString;
|
||||
public class QueryAuthResReq {
|
||||
|
||||
private String user;
|
||||
|
||||
private List<String> departmentIds = new ArrayList<>();
|
||||
|
||||
private List<AuthRes> resources;
|
||||
|
||||
private String domainId;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,18 @@
|
||||
package com.tencent.supersonic.auth.api.authorization.service;
|
||||
|
||||
import com.tencent.supersonic.auth.api.authorization.pojo.AuthGroup;
|
||||
import com.tencent.supersonic.auth.api.authorization.request.QueryAuthResReq;
|
||||
import com.tencent.supersonic.auth.api.authorization.response.AuthorizedResourceResp;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
public interface AuthService {
|
||||
|
||||
AuthorizedResourceResp queryAuthorizedResources(HttpServletRequest request, QueryAuthResReq req);
|
||||
List<AuthGroup> queryAuthGroups(String domainId, Integer groupId);
|
||||
|
||||
void updateAuthGroup(AuthGroup group);
|
||||
|
||||
void removeAuthGroup(AuthGroup group);
|
||||
|
||||
AuthorizedResourceResp queryAuthorizedResources(QueryAuthResReq req, HttpServletRequest request);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user