mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-10-30 18:17:55 +00:00 
			
		
		
		
	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
This commit is contained in:
		
							
								
								
									
										2
									
								
								.circleci/config.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								.circleci/config.yml
									
									
									
										generated
									
									
									
								
							| @@ -807,7 +807,7 @@ jobs: | |||||||
|     - run: |     - run: | ||||||
|         command: | |         command: | | ||||||
|           apk add --no-cache python3 py3-pip make |           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" |           export PATH="$HOME/.local/bin:$PATH" | ||||||
|  |  | ||||||
|           echo "$ semgrep --version" |           echo "$ semgrep --version" | ||||||
|   | |||||||
| @@ -7,7 +7,7 @@ steps: | |||||||
|       name: Setup Semgrep |       name: Setup Semgrep | ||||||
|       command: | |       command: | | ||||||
|         apk add --no-cache python3 py3-pip make |         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" |         export PATH="$HOME/.local/bin:$PATH" | ||||||
|  |  | ||||||
|         echo "$ semgrep --version" |         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 | 	// If the role had vhost permissions specified, assign those permissions | ||||||
| 	// to the created username for respective vhosts. | 	// to the created username for respective vhosts. | ||||||
| 	for vhost, permission := range role.VHosts { | 	for vhost, permission := range role.VHosts { | ||||||
| 		if err := func() error { | 		err := func() error { | ||||||
| 			resp, err := client.UpdatePermissionsIn(vhost, username, rabbithole.Permissions{ | 			resp, err := client.UpdatePermissionsIn(vhost, username, rabbithole.Permissions{ | ||||||
| 				Configure: permission.Configure, | 				Configure: permission.Configure, | ||||||
| 				Write:     permission.Write, | 				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 fmt.Errorf("error updating vhost permissions for %s - %d: %s", vhost, resp.StatusCode, body) | ||||||
| 			} | 			} | ||||||
| 			return nil | 			return nil | ||||||
| 		}(); err != nil { | 		}() | ||||||
|  | 		if err != nil { | ||||||
| 			return nil, err | 			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. | 	// to the created username for respective vhosts and exchange. | ||||||
| 	for vhost, permissions := range role.VHostTopics { | 	for vhost, permissions := range role.VHostTopics { | ||||||
| 		for exchange, permission := range permissions { | 		for exchange, permission := range permissions { | ||||||
| 			if err := func() error { | 			err := func() error { | ||||||
| 				resp, err := client.UpdateTopicPermissionsIn(vhost, username, rabbithole.TopicPermissions{ | 				resp, err := client.UpdateTopicPermissionsIn(vhost, username, rabbithole.TopicPermissions{ | ||||||
| 					Exchange: exchange, | 					Exchange: exchange, | ||||||
| 					Write:    permission.Write, | 					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 fmt.Errorf("error updating vhost permissions for %s - %d: %s", vhost, resp.StatusCode, body) | ||||||
| 				} | 				} | ||||||
| 				return nil | 				return nil | ||||||
| 			}(); err != nil { | 			}() | ||||||
|  | 			if err != nil { | ||||||
| 				return nil, err | 				return nil, err | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Steven Clark
					Steven Clark