File tree 10 files changed +52
-3
lines changed
10 files changed +52
-3
lines changed Original file line number Diff line number Diff line change 4
4
"net/http"
5
5
6
6
"github.com/kataras/iris/v12"
7
+ "github.com/kataras/iris/v12/context"
7
8
8
9
"github.com/casbin/casbin/v2"
9
10
)
@@ -13,6 +14,10 @@ import (
13
14
2020-08-08
14
15
*/
15
16
17
+ func init () {
18
+ context .SetHandlerName ("github.com/iris-contrib/middleware/casbin.*" , "iris-contrib.casbin" )
19
+ }
20
+
16
21
// New returns the auth service which receives a casbin enforcer.
17
22
//
18
23
// Adapt with its `Wrapper` for the entire application
Original file line number Diff line number Diff line change @@ -5,13 +5,18 @@ import (
5
5
"time"
6
6
7
7
"github.com/kataras/iris/v12"
8
+ "github.com/kataras/iris/v12/context"
8
9
9
10
"github.com/aws/aws-sdk-go/aws"
10
11
"github.com/aws/aws-sdk-go/aws/awserr"
11
12
"github.com/aws/aws-sdk-go/aws/session"
12
13
"github.com/aws/aws-sdk-go/service/cloudwatch"
13
14
)
14
15
16
+ func init () {
17
+ context .SetHandlerName ("github.com/iris-contrib/middleware/cloudwatch.*" , "iris-contrib.cloudwatch" )
18
+ }
19
+
15
20
// PutMetricContextKey is the context key which the metrics are stored.
16
21
const PutMetricContextKey = "PUT_METRIC"
17
22
Original file line number Diff line number Diff line change @@ -8,8 +8,13 @@ import (
8
8
"strings"
9
9
10
10
"github.com/kataras/iris/v12"
11
+ "github.com/kataras/iris/v12/context"
11
12
)
12
13
14
+ func init () {
15
+ context .SetHandlerName ("github.com/iris-contrib/middleware/cors.*" , "iris-contrib.cors" )
16
+ }
17
+
13
18
// Options is a configuration container to setup the CORS middleware.
14
19
type Options struct {
15
20
// AllowedOrigins is a list of origins a cross-domain request can be executed from.
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import (
11
11
)
12
12
13
13
func init () {
14
- context .SetHandlerName ("github.com/iris-contrib/middleware/csrf.*" , "iris.csrf.token" )
14
+ context .SetHandlerName ("github.com/iris-contrib/middleware/csrf.*" , "iris-contrib .csrf.token" )
15
15
}
16
16
17
17
// CSRF token length in bytes.
Original file line number Diff line number Diff line change @@ -6,10 +6,16 @@ import (
6
6
"strings"
7
7
"time"
8
8
9
- "github.com/dgrijalva/jwt-go"
10
9
"github.com/kataras/iris/v12"
10
+ "github.com/kataras/iris/v12/context"
11
+
12
+ "github.com/dgrijalva/jwt-go"
11
13
)
12
14
15
+ func init () {
16
+ context .SetHandlerName ("github.com/iris-contrib/middleware/jwt.*" , "iris-contrib.jwt" )
17
+ }
18
+
13
19
type (
14
20
// Token for JWT. Different fields will be used depending on whether you're
15
21
// creating or parsing/verifying a token.
Original file line number Diff line number Diff line change @@ -4,9 +4,15 @@ import (
4
4
"time"
5
5
6
6
"github.com/kataras/iris/v12"
7
+ "github.com/kataras/iris/v12/context"
8
+
7
9
"github.com/newrelic/go-agent/v3/newrelic"
8
10
)
9
11
12
+ func init () {
13
+ context .SetHandlerName ("github.com/iris-contrib/middleware/newrelic.*" , "iris-contrib.newrelic" )
14
+ }
15
+
10
16
// Migration from newrelic to newrelic/v3:
11
17
// https://github.com/newrelic/go-agent/blob/master/MIGRATION.md#configuration
12
18
Original file line number Diff line number Diff line change @@ -5,9 +5,15 @@ import (
5
5
"time"
6
6
7
7
"github.com/kataras/iris/v12"
8
+ "github.com/kataras/iris/v12/context"
9
+
8
10
"github.com/prometheus/client_golang/prometheus"
9
11
)
10
12
13
+ func init () {
14
+ context .SetHandlerName ("github.com/iris-contrib/middleware/prometheus.*" , "iris-contrib.prometheus" )
15
+ }
16
+
11
17
var (
12
18
// DefaultBuckets prometheus buckets in seconds.
13
19
DefaultBuckets = []float64 {0.3 , 1.2 , 5.0 }
Original file line number Diff line number Diff line change @@ -6,8 +6,13 @@ import (
6
6
"io"
7
7
8
8
"github.com/kataras/iris/v12"
9
+ "github.com/kataras/iris/v12/context"
9
10
)
10
11
12
+ func init () {
13
+ context .SetHandlerName ("github.com/iris-contrib/middleware/secure.*" , "iris-contrib.secure" )
14
+ }
15
+
11
16
const cspNonceKey string = "iris.secure.nonce"
12
17
13
18
// CSPNonce returns the nonce value associated with the present request. If no nonce has been generated it returns an empty string.
Original file line number Diff line number Diff line change @@ -7,10 +7,15 @@ import (
7
7
"strconv"
8
8
9
9
"github.com/kataras/iris/v12"
10
+ "github.com/kataras/iris/v12/context"
10
11
11
12
"github.com/throttled/throttled/v2"
12
13
)
13
14
15
+ func init () {
16
+ context .SetHandlerName ("github.com/iris-contrib/middleware/throttler.*" , "iris-contrib.throttler" )
17
+ }
18
+
14
19
var (
15
20
// DefaultDeniedHandler is the default DeniedHandler for an
16
21
// RateLimiter. It returns a 429 status code with a generic
Original file line number Diff line number Diff line change 2
2
package tollboothic
3
3
4
4
import (
5
+ "github.com/kataras/iris/v12"
6
+ "github.com/kataras/iris/v12/context"
7
+
5
8
"github.com/didip/tollbooth/v6"
6
9
"github.com/didip/tollbooth/v6/limiter"
7
- "github.com/kataras/iris/v12"
8
10
)
9
11
12
+ func init () {
13
+ context .SetHandlerName ("github.com/iris-contrib/middleware/tollboothic.*" , "iris-contrib.tollboothic" )
14
+ }
15
+
10
16
// LimitHandler is a middleware that performs
11
17
// rate-limiting given a "limiter" configuration.
12
18
//
You can’t perform that action at this time.
0 commit comments