diff --git a/Dockerfile b/Dockerfile index 128f1236a..5c180b90a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,9 +15,7 @@ COPY --from=builder /app/cassandra/schema.sql /usr/local/bin COPY --from=builder /app/dist/janus /bin/janus RUN chmod a+x /bin/janus && \ mkdir -p /etc/janus/apis && \ - mkdir -p /etc/janus/auth && \ - mkdir -p /etc/config - + mkdir -p /etc/janus/auth RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ diff --git a/assets/apis/example_SingleDefinition.json b/assets/apis/example_SingleDefinition.json deleted file mode 100644 index e42f52997..000000000 --- a/assets/apis/example_SingleDefinition.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name" : "countryCodes", - "active" : true, - "proxy" : { - "preserve_host" : false, - "listen_path" : "/me", - "upstreams" : { - "balancing": "roundrobin", - "targets": [ - {"target": "https://jut.su"} - ] - }, - "strip_path" : false, - "append_path" : false, - "methods" : ["GET"] - }, - "health_check": { - "url": "https://jut.su", - "timeout": 3 - }, - "plugins": [ - { - "name": "oauth2", - "enabled" : true, - "config": { - "server_name": "auth-jwt" - } - } - ] -} diff --git a/assets/auth/auth.json b/assets/auth/auth.json deleted file mode 100644 index d5460f6a0..000000000 --- a/assets/auth/auth.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name" : "auth-jwt", - "token_strategy" : { - "name" : "jwt", - "settings" : [ - {"alg": "HS256", "key" : "aboba"} - ] - } - -} diff --git a/pkg/cache/cache.go b/pkg/cache/cache.go deleted file mode 100644 index d57ae31d3..000000000 --- a/pkg/cache/cache.go +++ /dev/null @@ -1,46 +0,0 @@ -package cache - -import ( - "fmt" - "github.com/hellofresh/janus/pkg/models" - "sync" -) - -type Cache struct { - sync.RWMutex - Roles map[string]*models.Role -} - -func NewCache() *Cache { - roles := make(map[string]*models.Role) - - cache := &Cache{ - Roles: roles, - } - - return cache -} - -func (c *Cache) Set(key string, role *models.Role) { - c.Lock() - - defer c.Unlock() - - c.Roles[key] = &models.Role{ - Name: role.Name, - Features: role.Features, - } - -} - -func (c *Cache) Get(key string) (*models.Role, error) { - c.RLock() - defer c.RUnlock() - - item, found := c.Roles[key] - if !found { - return nil, fmt.Errorf("Role not found") - } - - return item, nil -} diff --git a/pkg/kafka/factConsumer.go b/pkg/kafka/factConsumer.go index f58eed93c..6c47d6306 100644 --- a/pkg/kafka/factConsumer.go +++ b/pkg/kafka/factConsumer.go @@ -3,7 +3,6 @@ package kafka import ( "context" "encoding/json" - "fmt" "github.com/hellofresh/janus/pkg/models" "github.com/segmentio/kafka-go" log "github.com/sirupsen/logrus" @@ -17,8 +16,6 @@ func StartFactConsumer(kafkaAddr, topic, dlqtopic, consumerGroup string) { if err != nil { return err } - fmt.Println("starting ping facts...") - var role models.Role err = json.Unmarshal(*fact.Object, &role) @@ -26,9 +23,6 @@ func StartFactConsumer(kafkaAddr, topic, dlqtopic, consumerGroup string) { log.Println(err) } - fmt.Println(role) - - fmt.Println("end of pinging gateway...") return nil }, func(msg Message, inerr error) { @@ -45,12 +39,6 @@ func StartFactConsumer(kafkaAddr, topic, dlqtopic, consumerGroup string) { return } -func factToCache(fact *models.Fact) *models.Fact { - return &models.Fact{ - Object: fact.Object, - } -} - type KafkaProducer struct { kafkaWriter *kafka.Writer } diff --git a/pkg/server/server.go b/pkg/server/server.go index 6c6062d83..4298471a5 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -3,7 +3,6 @@ package server import ( "context" "fmt" - "github.com/hellofresh/janus/pkg/cache" "net" "net/http" "time" @@ -38,13 +37,11 @@ type Server struct { webServer *web.Server profilingEnabled bool profilingPublic bool - cache *cache.Cache } // New creates a new instance of Server func New(opts ...Option) *Server { s := Server{ - cache: cache.NewCache(), configurationChan: make(chan api.ConfigurationChanged, 100), stopChan: make(chan struct{}, 1), }