Skip to content

Commit

Permalink
temporary workaround for jwt iat validation failing due to clock skew
Browse files Browse the repository at this point in the history
  • Loading branch information
JorritSalverda committed Aug 30, 2021
1 parent 76c4f17 commit 320615e
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,7 @@ import (
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"

crypt "github.com/estafette/estafette-ci-crypt"
foundation "github.com/estafette/estafette-foundation"
"github.com/fsnotify/fsnotify"
"github.com/gin-contrib/gzip"
"github.com/gin-gonic/gin"
"github.com/rs/zerolog/log"
"github.com/uber/jaeger-client-go"
jaegercfg "github.com/uber/jaeger-client-go/config"
jprom "github.com/uber/jaeger-lib/metrics/prometheus"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
"google.golang.org/api/option"
"google.golang.org/api/sourcerepo/v1"
stdsourcerepo "google.golang.org/api/sourcerepo/v1"

"github.com/estafette/estafette-ci-api/pkg/api"

"github.com/estafette/estafette-ci-api/pkg/clients/bigquery"
"github.com/estafette/estafette-ci-api/pkg/clients/bitbucketapi"
"github.com/estafette/estafette-ci-api/pkg/clients/builderapi"
Expand All @@ -45,7 +29,6 @@ import (
"github.com/estafette/estafette-ci-api/pkg/clients/prometheus"
"github.com/estafette/estafette-ci-api/pkg/clients/pubsubapi"
"github.com/estafette/estafette-ci-api/pkg/clients/slackapi"

"github.com/estafette/estafette-ci-api/pkg/services/bitbucket"
"github.com/estafette/estafette-ci-api/pkg/services/catalog"
"github.com/estafette/estafette-ci-api/pkg/services/cloudsource"
Expand All @@ -55,6 +38,21 @@ import (
"github.com/estafette/estafette-ci-api/pkg/services/queue"
"github.com/estafette/estafette-ci-api/pkg/services/rbac"
"github.com/estafette/estafette-ci-api/pkg/services/slack"
crypt "github.com/estafette/estafette-ci-crypt"
foundation "github.com/estafette/estafette-foundation"
"github.com/fsnotify/fsnotify"
"github.com/gin-contrib/gzip"
"github.com/gin-gonic/gin"
"github.com/golang-jwt/jwt/v4"
"github.com/rs/zerolog/log"
"github.com/uber/jaeger-client-go"
jaegercfg "github.com/uber/jaeger-client-go/config"
jprom "github.com/uber/jaeger-lib/metrics/prometheus"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
"google.golang.org/api/option"
"google.golang.org/api/sourcerepo/v1"
stdsourcerepo "google.golang.org/api/sourcerepo/v1"
)

var (
Expand Down Expand Up @@ -91,6 +89,11 @@ func main() {

ctx := foundation.InitCancellationContext(context.Background())

// https://github.com/golang-jwt/jwt/issues/98
jwt.TimeFunc = func() time.Time {
return time.Now().UTC().Add(time.Second * 20)
}

// start prometheus
foundation.InitMetricsWithPort(9001)

Expand Down

0 comments on commit 320615e

Please sign in to comment.