Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var FocalCmd = &cobra.Command{ Use: "focal", Short: "PAM authenticated proxy", Long: "A PAM authenticated proxy that supports JWT authentication and header authentication downstream", Example: `focal --token <token> --directory /path/to/directory.yml`, Run: func(cmd *cobra.Command, args []string) { viper.SetEnvPrefix("focal") viper.AutomaticEnv() err := viper.Unmarshal(&configuration) config := GetConfig() if err != nil { log.Fatalf("Unable to marshall viper into the designated struct. Details are: %s", err) } ta = jwtauth.New("HS256", []byte(config.Token), nil) directory, err := buildDirectory(config) if err != nil { log.Fatalf("Unable to read the provided directory file: %s", err) } r := Routes(directory) log.Infof("Listening on port %d", config.Port) http.ListenAndServe(":"+strconv.Itoa(config.Port), r) }, }
FocalCmdf is the primary cobra command executed to launch the service
Functions ¶
func Routes ¶
func Routes(directory Directions) chi.Router
Types ¶
type Config ¶
type Direction ¶
type Direction struct { Name string `yaml:"name"` Target string `yaml:"upstream"` Type string `yaml:"type"` }
Direction is a component used for dynamic routing
type Directions ¶
type Directions []Direction
Directions is a listing of objects that should be used for building reverse proxy targets
Click to show internal directories.
Click to hide internal directories.