docker/swarmkit

View on GitHub
ca/auth.go

Summary

Maintainability
A
1 hr
Test Coverage

Function AuthorizeForwardedRoleAndOrg has 7 return statements (exceeds 4 allowed).
Open

func AuthorizeForwardedRoleAndOrg(ctx context.Context, authorizedRoles, forwarderRoles []string, org string, blacklistedCerts map[string]*api.BlacklistedCertificate) (string, error) {
    if isForwardedRequest(ctx) {
        _, err := AuthorizeOrgAndRole(ctx, org, blacklistedCerts, forwarderRoles...)
        if err != nil {
            return "", status.Errorf(codes.PermissionDenied, "Permission denied: unauthorized forwarder role: %v", err)
Severity: Major
Found in ca/auth.go - About 45 mins to fix

    Function RemoteNode has 6 return statements (exceeds 4 allowed).
    Open

    func RemoteNode(ctx context.Context) (RemoteNodeInfo, error) {
        // If we have a value on the context that marks this as a local
        // request, we return the node info from the context.
        localNodeInfo := ctx.Value(LocalRequestKey)
    
    
    Severity: Major
    Found in ca/auth.go - About 40 mins to fix

      There are no issues that match your filters.

      Category
      Status