Skip to content

Commit e521124

Browse files
authored
Add owner management state check to Launch RPC (#155)
1 parent 2c44ada commit e521124

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

ocp/rpc/currency/launch.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,15 @@ func (s *currencyServer) Launch(ctx context.Context, req *currencypb.LaunchReque
9090
}
9191
}
9292

93+
ownerManagementState, err := common.GetOwnerManagementState(ctx, s.data, ownerAccount)
94+
if err != nil {
95+
log.With(zap.Error(err)).Warn("failure getting owner management state")
96+
return &currencypb.LaunchResponse{Result: currencypb.LaunchResponse_DENIED}, nil
97+
}
98+
if ownerManagementState != common.OwnerManagementStateOcpAccount {
99+
return &currencypb.LaunchResponse{Result: currencypb.LaunchResponse_DENIED}, nil
100+
}
101+
93102
allow, err := s.antispamGuard.AllowCurrencyLaunch(ctx, ownerAccount, name, symbol)
94103
if err != nil {
95104
log.With(zap.Error(err)).Warn("failed to perform antispam checks")

0 commit comments

Comments
 (0)