Remove unused functions

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
Gabriel Adrian Samfira 2023-01-20 23:52:27 +02:00
parent 4063265478
commit 70fd3f47d0
No known key found for this signature in database
GPG key ID: 7D073DCC2C074CB5
5 changed files with 10 additions and 18 deletions

View file

@ -8,6 +8,12 @@ on:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
permissions: {}
jobs:
linters:
name: Linters
@ -48,4 +54,4 @@ jobs:
- run: go version
- name: Run GARM Go Tests
run: make test
run: make go-test

View file

@ -18,7 +18,9 @@ build-static:
@echo Binaries are available in $(PWD)/bin
.PHONY: test
test:
test: verify go-test
go-test:
go test -race -mod=vendor -tags testing -v $(TEST_ARGS) -timeout=15m -parallel=4 -count=1 ./...
fmtcheck:

View file

@ -157,20 +157,6 @@ func FullName(ctx context.Context) string {
return name.(string)
}
// SetJWTClaim will set the JWT claim in the context
func SetJWTClaim(ctx context.Context, claim JWTClaims) context.Context {
return context.WithValue(ctx, jwtTokenFlag, claim)
}
// JWTClaim returns the JWT claim saved in the context
func JWTClaim(ctx context.Context) JWTClaims {
jwtClaim := ctx.Value(jwtTokenFlag)
if jwtClaim == nil {
return JWTClaims{}
}
return jwtClaim.(JWTClaims)
}
// SetIsEnabled sets a flag indicating if account is enabled
func SetIsEnabled(ctx context.Context, enabled bool) context.Context {
return context.WithValue(ctx, isEnabledFlag, enabled)

View file

@ -155,7 +155,6 @@ func (amw *instanceMiddleware) Middleware(next http.Handler) http.Handler {
return
}
// ctx = SetJWTClaim(ctx, *claims)
next.ServeHTTP(w, r.WithContext(ctx))
})
}

View file

@ -128,7 +128,6 @@ func (amw *jwtMiddleware) Middleware(next http.Handler) http.Handler {
return
}
ctx = SetJWTClaim(ctx, *claims)
next.ServeHTTP(w, r.WithContext(ctx))
})
}