Remove unused functions
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
parent
4063265478
commit
70fd3f47d0
5 changed files with 10 additions and 18 deletions
8
.github/workflows/go-tests.yml
vendored
8
.github/workflows/go-tests.yml
vendored
|
|
@ -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
|
||||
|
|
|
|||
4
Makefile
4
Makefile
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -155,7 +155,6 @@ func (amw *instanceMiddleware) Middleware(next http.Handler) http.Handler {
|
|||
return
|
||||
}
|
||||
|
||||
// ctx = SetJWTClaim(ctx, *claims)
|
||||
next.ServeHTTP(w, r.WithContext(ctx))
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -128,7 +128,6 @@ func (amw *jwtMiddleware) Middleware(next http.Handler) http.Handler {
|
|||
return
|
||||
}
|
||||
|
||||
ctx = SetJWTClaim(ctx, *claims)
|
||||
next.ServeHTTP(w, r.WithContext(ctx))
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue