emissary/internal/auth/agent/user.go

24 lines
390 B
Go
Raw Normal View History

package agent
import (
"fmt"
"forge.cadoles.com/Cadoles/emissary/internal/auth"
"forge.cadoles.com/Cadoles/emissary/internal/datastore"
)
type User struct {
agent *datastore.Agent
}
// Subject implements auth.User
func (u *User) Subject() string {
return fmt.Sprintf("agent#%d", u.agent.ID)
}
func (u *User) Agent() *datastore.Agent {
return u.agent
}
var _ auth.User = &User{}