2020-11-30 09:37:17 +00:00
|
|
|
package v1
|
|
|
|
|
|
|
|
import "github.com/crowdsecurity/crowdsec/pkg/database"
|
|
|
|
|
|
|
|
type Middlewares struct {
|
|
|
|
APIKey *APIKey
|
|
|
|
JWT *JWT
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewMiddlewares(dbClient *database.Client) (*Middlewares, error) {
|
|
|
|
var err error
|
|
|
|
|
|
|
|
ret := &Middlewares{}
|
|
|
|
|
|
|
|
ret.JWT, err = NewJWT(dbClient)
|
|
|
|
if err != nil {
|
2023-12-04 22:06:01 +00:00
|
|
|
return nil, err
|
2020-11-30 09:37:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ret.APIKey = NewAPIKey(dbClient)
|
2024-01-15 11:38:31 +00:00
|
|
|
|
2020-11-30 09:37:17 +00:00
|
|
|
return ret, nil
|
|
|
|
}
|