Skip to content

Commit

Permalink
new/api: timed abstract (#85)
Browse files Browse the repository at this point in the history
This patch adds the @timed.abs and make use of it in relevant specs. It
also adds support for setting it from the crud package.
  • Loading branch information
primalmotion committed Apr 24, 2023
1 parent bea9a5a commit 4807bfd
Show file tree
Hide file tree
Showing 20 changed files with 1,430 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmd/a3s/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,8 @@ func initRootPermissions(ctx context.Context, m manipulate.Manipulator, caPath s
source.Name = "root"
source.Description = "Auth source to authenticate root users"
source.CA = string(caData)
source.CreateTime = time.Now()
source.UpdateTime = source.CreateTime
certs, err := tglib.ParseCertificates([]byte(source.CA))
if err != nil {
return false, err
Expand Down Expand Up @@ -504,6 +506,8 @@ func initRootPermissions(ctx context.Context, m manipulate.Manipulator, caPath s
auth.Permissions = []string{"*:*"}
auth.TargetNamespaces = []string{"/"}
auth.Hidden = true
auth.CreateTime = time.Now()
auth.UpdateTime = auth.CreateTime

if err := m.Create(manipulate.NewContext(ctx), auth); err != nil {
return false, fmt.Errorf("unable to create root auth: %w", err)
Expand Down Expand Up @@ -534,6 +538,8 @@ func initPlatformPermissions(ctx context.Context, m manipulate.Manipulator, caPa
source.Name = "platform"
source.Description = "Auth source used to authenticate internal platform services"
source.CA = string(caData)
source.CreateTime = time.Now()
source.UpdateTime = source.CreateTime
certs, err := tglib.ParseCertificates([]byte(source.CA))
if err != nil {
return false, err
Expand Down Expand Up @@ -569,6 +575,8 @@ func initPlatformPermissions(ctx context.Context, m manipulate.Manipulator, caPa
auth.Permissions = []string{"*:*"}
auth.TargetNamespaces = []string{"/"}
auth.Hidden = true
auth.CreateTime = time.Now()
auth.UpdateTime = auth.CreateTime

if err := m.Create(manipulate.NewContext(ctx), auth); err != nil {
return false, fmt.Errorf("unable to create root auth: %w", err)
Expand Down
Loading

0 comments on commit 4807bfd

Please sign in to comment.