Option to add staticPasswords from environment variables
Signed-off-by: justin-slowik <justin.slowik@thermofisher.com>
This commit is contained in:
		
				
					committed by
					
						
						justin-slowik
					
				
			
			
				
	
			
			
			
						parent
						
							62efe7bf07
						
					
				
				
					commit
					776aa9dd53
				
			@@ -103,7 +103,11 @@ func (p *password) UnmarshalJSON(b []byte) error {
 | 
			
		||||
		data.Hash = os.Getenv(data.HashFromEnv)
 | 
			
		||||
	}
 | 
			
		||||
	if len(data.Hash) == 0 {
 | 
			
		||||
		return fmt.Errorf("no password hash provided")
 | 
			
		||||
		if len(data.HashFromEnv) > 0 {
 | 
			
		||||
			data.Hash = os.Getenv(data.HashFromEnv)
 | 
			
		||||
		} else {
 | 
			
		||||
			return fmt.Errorf("no password hash provided")
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// If this value is a valid bcrypt, use it.
 | 
			
		||||
 
 | 
			
		||||
@@ -4,6 +4,8 @@ import (
 | 
			
		||||
	"os"
 | 
			
		||||
	"testing"
 | 
			
		||||
 | 
			
		||||
	"github.com/dexidp/dex/server"
 | 
			
		||||
 | 
			
		||||
	"github.com/ghodss/yaml"
 | 
			
		||||
	"github.com/kylelemons/godebug/pretty"
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user