proxy2 does auth inline

This commit is contained in:
bel
2024-03-10 11:08:51 -06:00
parent fb6d7af6d3
commit abf628d2bb
6 changed files with 51 additions and 172 deletions

View File

@@ -4,13 +4,14 @@ import (
"bytes"
"crypto/tls"
"io"
"gitea.inhome.blapointe.com/local/rproxy3/config"
"gitea.inhome.blapointe.com/local/rproxy3/storage/packable"
"log"
"net/http"
"net/http/httputil"
"net/url"
"strings"
"gitea.inhome.blapointe.com/local/rproxy3/config"
"gitea.inhome.blapointe.com/local/rproxy3/storage/packable"
)
type redirPurge struct {
@@ -51,10 +52,10 @@ func (s *Server) lookup(host string) (*url.URL, error) {
return v.URL(), err
}
func (s *Server) lookupAuth(host string) (bool, error) {
func (s *Server) lookupAuth(host string) (string, error) {
v := packable.NewString()
err := s.db.Get(nsBOAuthZ, host, v)
return v.String() == "true", err
err := s.db.Get(nsRouting, host+"//auth", v)
return v.String(), err
}
func mapKey(host string) string {