mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-11-04 04:28:08 +00:00 
			
		
		
		
	Don't allow a policy with no name, even though it is a valid slice member
This commit is contained in:
		@@ -623,6 +623,11 @@ func (ts *TokenStore) handleCreateCommon(
 | 
				
			|||||||
	// Use a map to filter out/prevent duplicates
 | 
						// Use a map to filter out/prevent duplicates
 | 
				
			||||||
	policyMap := map[string]bool{}
 | 
						policyMap := map[string]bool{}
 | 
				
			||||||
	for _, policy := range data.Policies {
 | 
						for _, policy := range data.Policies {
 | 
				
			||||||
 | 
							if policy == "" {
 | 
				
			||||||
 | 
								// Don't allow a policy with no name, even though it is a valid
 | 
				
			||||||
 | 
								// slice member
 | 
				
			||||||
 | 
								continue
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		policyMap[policy] = true
 | 
							policyMap[policy] = true
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if !policyMap["root"] &&
 | 
						if !policyMap["root"] &&
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user