mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-13 03:24:26 +00:00
385a55bd21
* feat: enable limiting audit trail * support AddExclusiveQuery * fix invalid condition * register event mappers * fix NullDuration validity * test query side for limits * lint * acceptance test audit trail limit * fix acceptance test * translate limits not found * update tests * fix linting * add audit log retention to default instance * fix tests * update docs * remove todo * improve test name
33 lines
907 B
Go
33 lines
907 B
Go
package system
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/zitadel/zitadel/internal/api/grpc/object"
|
|
"github.com/zitadel/zitadel/pkg/grpc/system"
|
|
)
|
|
|
|
func (s *Server) SetLimits(ctx context.Context, req *system.SetLimitsRequest) (*system.SetLimitsResponse, error) {
|
|
details, err := s.command.SetLimits(
|
|
ctx,
|
|
req.GetInstanceId(),
|
|
instanceLimitsPbToCommand(req),
|
|
)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &system.SetLimitsResponse{
|
|
Details: object.AddToDetailsPb(details.Sequence, details.EventDate, details.ResourceOwner),
|
|
}, nil
|
|
}
|
|
|
|
func (s *Server) ResetLimits(ctx context.Context, req *system.ResetLimitsRequest) (*system.ResetLimitsResponse, error) {
|
|
details, err := s.command.ResetLimits(ctx, req.GetInstanceId())
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &system.ResetLimitsResponse{
|
|
Details: object.ChangeToDetailsPb(details.Sequence, details.EventDate, details.ResourceOwner),
|
|
}, nil
|
|
}
|