mirror of
https://github.com/kataras/iris.git
synced 2025-12-24 05:17:03 +00:00
update dependencies
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
module myapp
|
||||
|
||||
go 1.24.3
|
||||
go 1.25
|
||||
|
||||
require (
|
||||
github.com/go-sql-driver/mysql v1.9.2
|
||||
|
||||
@@ -45,7 +45,7 @@ func main() {
|
||||
}
|
||||
|
||||
// Validate a user from database.
|
||||
allowFunc := func(ctx iris.Context, username, password string) (interface{}, bool) {
|
||||
allowFunc := func(ctx iris.Context, username, password string) (any, bool) {
|
||||
user, err := db.getUserByUsernameAndPassword(context.Background(), username, password)
|
||||
return user, err == nil
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ func main() {
|
||||
},
|
||||
// The users can be a slice of custom users structure
|
||||
// or a map[string]string (username:password)
|
||||
// or []map[string]interface{} with username and passwords required fields,
|
||||
// or []map[string]any with username and passwords required fields,
|
||||
// read the godocs for more.
|
||||
Allow: basicauth.AllowUsers(users),
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ func main() {
|
||||
//
|
||||
// And then register it:
|
||||
verifier.Blocklist = blocklist
|
||||
verifyMiddleware := verifier.Verify(func() interface{} {
|
||||
verifyMiddleware := verifier.Verify(func() any {
|
||||
return new(userClaims)
|
||||
})
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ func main() {
|
||||
verifier.WithDefaultBlocklist()
|
||||
// Enable payload decryption with:
|
||||
// verifier.WithDecryption(encKey, nil)
|
||||
verifyMiddleware := verifier.Verify(func() interface{} {
|
||||
verifyMiddleware := verifier.Verify(func() any {
|
||||
return new(fooClaims)
|
||||
})
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ func main() {
|
||||
|
||||
protectedAPI := app.Party("/protected")
|
||||
{
|
||||
verifyMiddleware := verifier.Verify(func() interface{} {
|
||||
verifyMiddleware := verifier.Verify(func() any {
|
||||
return new(UserClaims)
|
||||
})
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ func Verify() iris.Handler {
|
||||
|
||||
verifier := jwt.NewVerifier(jwt.HS256, []byte(secret), jwt.Expected{Issuer: util.AppName})
|
||||
verifier.Extractors = []jwt.TokenExtractor{jwt.FromHeader} // extract token only from Authorization: Bearer $token
|
||||
return verifier.Verify(func() interface{} {
|
||||
return verifier.Verify(func() any {
|
||||
return new(UserClaims)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ func Do(method, url string, body io.Reader, opts ...RequestOption) (*http.Respon
|
||||
}
|
||||
|
||||
// JSON fires a request with "v" as client json data.
|
||||
func JSON(method, url string, v interface{}, opts ...RequestOption) (*http.Response, error) {
|
||||
func JSON(method, url string, v any, opts ...RequestOption) (*http.Response, error) {
|
||||
buf := new(bytes.Buffer)
|
||||
err := json.NewEncoder(buf).Encode(v)
|
||||
if err != nil {
|
||||
@@ -85,7 +85,7 @@ func Form(method, url string, formData url.Values, opts ...RequestOption) (*http
|
||||
}
|
||||
|
||||
// BindResponse binds a response body to the "dest" pointer and closes the body.
|
||||
func BindResponse(resp *http.Response, dest interface{}) error {
|
||||
func BindResponse(resp *http.Response, dest any) error {
|
||||
contentType := resp.Header.Get("Content-Type")
|
||||
if idx := strings.IndexRune(contentType, ';'); idx > 0 {
|
||||
contentType = contentType[0:idx]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module myapp
|
||||
|
||||
go 1.24.3
|
||||
go 1.25
|
||||
|
||||
require (
|
||||
github.com/google/uuid v1.6.0
|
||||
|
||||
Reference in New Issue
Block a user