feat: Add GetInstance endpoint (#9452)

This commit is contained in:
Marco Ardizzone
2025-04-24 17:12:16 +02:00
parent 606439a172
commit da11910ba9
5 changed files with 168 additions and 1 deletions

View File

@@ -2,6 +2,7 @@ package object
import (
"context"
"time"
"google.golang.org/protobuf/types/known/timestamppb"
@@ -176,3 +177,22 @@ func MFAStateToPb(state domain.MFAState) user_pb.AuthFactorState {
return user_pb.AuthFactorState_AUTH_FACTOR_STATE_UNSPECIFIED
}
}
func ToViewDetailsPb(
sequence uint64,
creationDate,
changeDate time.Time,
resourceOwner string,
) *object.Details {
details := &object.Details{
Sequence: sequence,
ResourceOwner: resourceOwner,
}
if !creationDate.IsZero() {
details.CreationDate = timestamppb.New(creationDate)
}
if !changeDate.IsZero() {
details.ChangeDate = timestamppb.New(changeDate)
}
return details
}