Unverified Commit 1a01f2a6 authored by Steven Clark's avatar Steven Clark Committed by GitHub
Browse files

Address semgrep 0.86.x breakage (#14771)

* Fix semgrep 0.86.5 parsing failures
 - semgrep https://github.com/returntocorp/semgrep/pull/4671 seems to have
   introduce this parsing failure within version 0.86.0 and higher
 - Workaround parsing failure by breaking out the if error check.

* Pin semgrep version to 0.86.5

* Fix formatting issues
parent 2230232e
Showing with 8 additions and 6 deletions
+8 -6
......@@ -807,7 +807,7 @@ jobs:
- run:
command: |
apk add --no-cache python3 py3-pip make
python3 -m pip install --user semgrep
python3 -m pip install --user semgrep==0.86.5
export PATH="$HOME/.local/bin:$PATH"
echo "$ semgrep --version"
......
......@@ -7,7 +7,7 @@ steps:
name: Setup Semgrep
command: |
apk add --no-cache python3 py3-pip make
python3 -m pip install --user semgrep
python3 -m pip install --user semgrep==0.86.5
export PATH="$HOME/.local/bin:$PATH"
echo "$ semgrep --version"
......
......@@ -127,7 +127,7 @@ func (b *backend) pathCredsRead(ctx context.Context, req *logical.Request, d *fr
// If the role had vhost permissions specified, assign those permissions
// to the created username for respective vhosts.
for vhost, permission := range role.VHosts {
if err := func() error {
err := func() error {
resp, err := client.UpdatePermissionsIn(vhost, username, rabbithole.Permissions{
Configure: permission.Configure,
Write: permission.Write,
......@@ -146,7 +146,8 @@ func (b *backend) pathCredsRead(ctx context.Context, req *logical.Request, d *fr
return fmt.Errorf("error updating vhost permissions for %s - %d: %s", vhost, resp.StatusCode, body)
}
return nil
}(); err != nil {
}()
if err != nil {
return nil, err
}
}
......@@ -155,7 +156,7 @@ func (b *backend) pathCredsRead(ctx context.Context, req *logical.Request, d *fr
// to the created username for respective vhosts and exchange.
for vhost, permissions := range role.VHostTopics {
for exchange, permission := range permissions {
if err := func() error {
err := func() error {
resp, err := client.UpdateTopicPermissionsIn(vhost, username, rabbithole.TopicPermissions{
Exchange: exchange,
Write: permission.Write,
......@@ -174,7 +175,8 @@ func (b *backend) pathCredsRead(ctx context.Context, req *logical.Request, d *fr
return fmt.Errorf("error updating vhost permissions for %s - %d: %s", vhost, resp.StatusCode, body)
}
return nil
}(); err != nil {
}()
if err != nil {
return nil, err
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment