mirror of
https://github.com/datarhei/core.git
synced 2025-10-16 04:50:44 +08:00
Create identity and access packages for IAM
This commit is contained in:
@@ -17,6 +17,8 @@ import (
|
||||
"github.com/datarhei/core/v16/http/errorhandler"
|
||||
"github.com/datarhei/core/v16/http/validator"
|
||||
"github.com/datarhei/core/v16/iam"
|
||||
iamaccess "github.com/datarhei/core/v16/iam/access"
|
||||
iamidentity "github.com/datarhei/core/v16/iam/identity"
|
||||
"github.com/datarhei/core/v16/internal/testhelper"
|
||||
"github.com/datarhei/core/v16/io/fs"
|
||||
"github.com/datarhei/core/v16/restream"
|
||||
@@ -53,9 +55,20 @@ func DummyRestreamer(pathPrefix string) (restream.Restreamer, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
policyAdapter, err := iamaccess.NewJSONAdapter(memfs, "./policy.json", nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
identityAdapter, err := iamidentity.NewJSONAdapter(memfs, "./users.json", nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
iam, err := iam.NewIAM(iam.Config{
|
||||
FS: memfs,
|
||||
Superuser: iam.User{
|
||||
PolicyAdapter: policyAdapter,
|
||||
IdentityAdapter: identityAdapter,
|
||||
Superuser: iamidentity.User{
|
||||
Name: "foobar",
|
||||
},
|
||||
JWTRealm: "",
|
||||
|
Reference in New Issue
Block a user