add username to our trip
This commit is contained in:
@@ -63,7 +63,7 @@ func (ao *Peer) RemoveExecution(exec PeerExecution) {
|
||||
|
||||
// IsMySelf checks if the peer is the local peer
|
||||
func (ao *Peer) IsMySelf() (bool, string) {
|
||||
d, code, err := New(tools.PEER, "", nil, nil).Search(nil, SELF.String())
|
||||
d, code, err := New(tools.PEER, "", "", nil, nil).Search(nil, SELF.String())
|
||||
if code != 200 || err != nil || len(d) == 0 {
|
||||
return false, ""
|
||||
}
|
||||
@@ -76,7 +76,7 @@ func (p *Peer) LaunchPeerExecution(peerID string, dataID string, dt tools.DataTy
|
||||
p.UUID = peerID
|
||||
return cache.LaunchPeerExecution(peerID, dataID, dt, method, body, caller) // Launch the execution on the peer through the cache
|
||||
}
|
||||
func (d *Peer) GetAccessor(peerID string, groups []string, caller *tools.HTTPCaller) utils.Accessor {
|
||||
data := New(tools.PEER, peerID, groups, caller) // Create a new instance of the accessor
|
||||
func (d *Peer) GetAccessor(username string, peerID string, groups []string, caller *tools.HTTPCaller) utils.Accessor {
|
||||
data := New(tools.PEER, username, peerID, groups, caller) // Create a new instance of the accessor
|
||||
return data
|
||||
}
|
||||
|
@@ -23,12 +23,13 @@ func NewShallow() *peerMongoAccessor {
|
||||
}
|
||||
}
|
||||
|
||||
func New(t tools.DataType, peerID string, groups []string, caller *tools.HTTPCaller) *peerMongoAccessor {
|
||||
func New(t tools.DataType, username string, peerID string, groups []string, caller *tools.HTTPCaller) *peerMongoAccessor {
|
||||
return &peerMongoAccessor{
|
||||
utils.AbstractAccessor{
|
||||
Logger: logs.CreateLogger(t.String()), // Create a logger with the data type
|
||||
Caller: caller,
|
||||
PeerID: peerID,
|
||||
User: username,
|
||||
Groups: groups, // Set the caller
|
||||
Type: t,
|
||||
},
|
||||
|
Reference in New Issue
Block a user