feat(client): tenant management commands

This commit is contained in:
2024-02-27 14:14:30 +01:00
parent 15a0bf6ecc
commit c851a1f51b
61 changed files with 1376 additions and 272 deletions

View File

@ -83,7 +83,7 @@ func (a *Authenticator) Authenticate(ctx context.Context, r *http.Request) (auth
return nil, errors.WithStack(auth.ErrUnauthenticated)
}
contactedAt := time.Now()
contactedAt := time.Now().UTC()
agent, err = a.repo.Update(ctx, agent.ID, datastore.WithAgentUpdateContactedAt(contactedAt))
if err != nil {

View File

@ -1,4 +1,4 @@
package thirdparty
package user
import (
"context"

View File

@ -1,4 +1,4 @@
package thirdparty
package user
import (
"context"

View File

@ -1,4 +1,4 @@
package thirdparty
package user
import (
"forge.cadoles.com/Cadoles/emissary/internal/auth"
@ -10,12 +10,13 @@ type Role string
const (
RoleWriter Role = "writer"
RoleReader Role = "reader"
RoleAdmin Role = "admin"
)
func isValidRole(r string) bool {
rr := Role(r)
return rr == RoleWriter || rr == RoleReader
return rr == RoleWriter || rr == RoleReader || rr == RoleAdmin
}
type User struct {