in api/src/gmsa_service.cpp [1906:1982]
void Proceed( std::string krb_files_dir, CF_logger& cf_logger,
std::string aws_sm_secret_name )
{
if ( cookie.compare( CLASS_NAME_CallDataDeleteKerberosLease ) != 0 )
{
return;
}
std::cerr << Util::getCurrentTime() << '\t' << "INFO: CallDataDeleteKerberosLease "
<< this << "status: " << status_ << std::endl;
if ( status_ == CREATE )
{
// Make this instance progress to the PROCESS state.
status_ = PROCESS;
// As part of the initial CREATE state, we *request* that the system
// start processing RequestAddKerberosLease requests. In this request, "this" acts
// are the tag uniquely identifying the request (so that different CallData
// instances can serve different requests concurrently), in this case
// the memory address of this CallData instance.
service_->RequestDeleteKerberosLease( &del_krb_ctx_, &delete_krb_request_,
&delete_krb_responder_, cq_, cq_, this );
}
else if ( status_ == PROCESS )
{
// Spawn a new CallData instance to serve new clients while we process
// the one for this CallData. The instance will deallocate itself as
// part of its FINISH state.
new CallDataDeleteKerberosLease( service_, cq_ );
// The actual processing.
std::string lease_id = delete_krb_request_.lease_id();
std::string err_msg;
if ( !lease_id.empty() )
{
std::vector<std::string> deleted_krb_file_paths =
delete_krb_tickets( krb_files_dir, lease_id );
for ( auto deleted_krb_path : deleted_krb_file_paths )
{
delete_krb_reply_.add_deleted_kerberos_file_paths( deleted_krb_path );
}
delete_krb_reply_.set_lease_id( lease_id );
}
else
{
err_msg = "Error: lease_id is not valid";
std::cerr << Util::getCurrentTime() << '\t' << err_msg << std::endl;
}
// And we are done! Let the gRPC runtime know we've finished, using the
// memory address of this instance as the uniquely identifying tag for
// the event.
if ( !err_msg.empty() )
{
status_ = FINISH;
delete_krb_responder_.Finish(
delete_krb_reply_, grpc::Status( grpc::StatusCode::INTERNAL, err_msg ),
this );
}
else
{
status_ = FINISH;
delete_krb_responder_.Finish( delete_krb_reply_, grpc::Status::OK, this );
}
}
else
{
GPR_ASSERT( status_ == FINISH );
// Once in the FINISH state, deallocate ourselves (CallData).
delete this;
}
return;
}