whitelist를 mg로 이동
This commit is contained in:
@ -175,8 +175,10 @@ type Maingate struct {
|
||||
|
||||
auths *common.AuthCollection
|
||||
//services servicelist
|
||||
serviceptr unsafe.Pointer
|
||||
admins unsafe.Pointer
|
||||
serviceptr unsafe.Pointer
|
||||
admins unsafe.Pointer
|
||||
wl whitelist
|
||||
|
||||
tokenEndpoints map[string]string
|
||||
authorizationEndpoints map[string]string
|
||||
userinfoEndpoint map[string]string
|
||||
@ -422,6 +424,12 @@ func (mg *Maingate) prepare(context context.Context) (err error) {
|
||||
}
|
||||
}
|
||||
|
||||
var whites []whitelistmember
|
||||
if err := mg.mongoClient.AllAs(CollectionWhitelist, &whites, options.Find().SetReturnKey(false)); err != nil {
|
||||
return err
|
||||
}
|
||||
mg.wl.init(whites)
|
||||
|
||||
go watchAuthCollection(context, mg.auths, mg.mongoClient)
|
||||
go mg.watchWhitelistCollection(context)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user