Skip to content

Commit

Permalink
polish: use httputil consts
Browse files Browse the repository at this point in the history
Signed-off-by: CeerDecy <[email protected]>
  • Loading branch information
CeerDecy committed Sep 12, 2024
1 parent 6282cd4 commit 047e341
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func Terminal(clusterSvc clusterpb.ClusterServiceServer, w http.ResponseWriter,

if args.PodName != "" && args.Namespace != "" && args.ContainerName != "" {
logrus.Infof("get termial connect param from args")
orgID, _ = strconv.Atoi(r.Header.Get("org-id"))
orgID, _ = strconv.Atoi(r.Header.Get(httputil.OrgHeader))
k8snamespace = args.Namespace
k8scontainername = args.ContainerName
k8spodname = args.PodName
Expand Down Expand Up @@ -179,7 +179,7 @@ func Terminal(clusterSvc clusterpb.ClusterServiceServer, w http.ResponseWriter,
return

Check warning on line 179 in internal/tools/orchestrator/scheduler/impl/terminal/terminal.go

View check run for this annotation

Codecov / codecov/patch

internal/tools/orchestrator/scheduler/impl/terminal/terminal.go#L174-L179

Added lines #L174 - L179 were not covered by tests
}
p, err := bundle.New(bundle.WithErdaServer()).CheckPermission(&apistructs.PermissionCheckRequest{
UserID: r.Header.Get("User-ID"),
UserID: r.Header.Get(httputil.UserHeader),
Scope: apistructs.OrgScope,
ScopeID: orgid,
Resource: "terminal",
Expand All @@ -200,7 +200,7 @@ func Terminal(clusterSvc clusterpb.ClusterServiceServer, w http.ResponseWriter,
return

Check warning on line 200 in internal/tools/orchestrator/scheduler/impl/terminal/terminal.go

View check run for this annotation

Codecov / codecov/patch

internal/tools/orchestrator/scheduler/impl/terminal/terminal.go#L196-L200

Added lines #L196 - L200 were not covered by tests
}
p, err := bundle.New(bundle.WithErdaServer()).CheckPermission(&apistructs.PermissionCheckRequest{
UserID: r.Header.Get("User-ID"),
UserID: r.Header.Get(httputil.UserHeader),
Scope: apistructs.AppScope,
ScopeID: appid,
Resource: "terminal",
Expand Down Expand Up @@ -233,7 +233,7 @@ func Terminal(clusterSvc clusterpb.ClusterServiceServer, w http.ResponseWriter,
}

auditor := &Auditor{
userID: r.Header.Get("User-ID"),
userID: r.Header.Get(httputil.UserHeader),

Check warning on line 236 in internal/tools/orchestrator/scheduler/impl/terminal/terminal.go

View check run for this annotation

Codecov / codecov/patch

internal/tools/orchestrator/scheduler/impl/terminal/terminal.go#L236

Added line #L236 was not covered by tests
orgID: uint64(orgID),
bdl: bundle.New(bundle.WithErdaServer()),
podName: k8spodname,
Expand Down

0 comments on commit 047e341

Please sign in to comment.