Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Middleware to validate request for d.velop lifecylce events from d.velop cloud center (second try) #30

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
2 changes: 1 addition & 1 deletion environment/environmentmiddleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ func Get(ctx context.Context) string {
return ""
}
return value
}
}
3 changes: 2 additions & 1 deletion environment/environmentmiddleware_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package environment_test

import (
"github.com/d-velop/dvelop-sdk-go/environment"
"net/http"
"net/http/httptest"
"testing"

"github.com/d-velop/dvelop-sdk-go/environment"
)

func TestRequestWithEnvironmentFunction_UsesReturnedEnvironment(t *testing.T) {
Expand Down
1 change: 1 addition & 0 deletions idp/authmiddleware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"net/url"
"reflect"
"testing"

"time"

"github.com/d-velop/dvelop-sdk-go/idp"
Expand Down
3 changes: 2 additions & 1 deletion idp/test/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package test

import (
"encoding/json"
"github.com/d-velop/dvelop-sdk-go/idp/scim"
"net/http"
"net/http/httptest"
"regexp"

"github.com/d-velop/dvelop-sdk-go/idp/scim"
)

var bearerTokenRegex = regexp.MustCompile("^(?i)bearer (.*)$")
Expand Down
5 changes: 3 additions & 2 deletions lambda/environment.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package lambda

import (
"github.com/aws/aws-lambda-go/lambdacontext"
"net/http"
"strings"

"github.com/aws/aws-lambda-go/lambdacontext"
)

func GetAliasFromRequest(req http.Request) string {
Expand All @@ -18,4 +19,4 @@ func GetAliasFromRequest(req http.Request) string {
}

return ""
}
}
5 changes: 3 additions & 2 deletions lambda/environment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package lambda_test

import (
"context"
"github.com/aws/aws-lambda-go/lambdacontext"
"github.com/d-velop/dvelop-sdk-go/lambda"
"net/http"
"testing"

"github.com/aws/aws-lambda-go/lambdacontext"
"github.com/d-velop/dvelop-sdk-go/lambda"
)

func TestGetAliasFromRequest_LambdaArnHasNamedLambdaAlias_ReturnsAliasFromArn(t *testing.T) {
Expand Down
3 changes: 3 additions & 0 deletions requestsignature/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/d-velop/dvelop-sdk-go/requestsignature

go 1.13
Loading