app/controllers/admin_configurations_controller.rb
# register or update the FireCloud profile of the portal service account
register or update the FireCloud profile of the portal service account
register or update the FireCloud profile of the portal service account
def update_service_account_profile
    @client = params[:account] == 'gcs_admin' ? ApplicationController.gcs_client : ApplicationController.fire_cloud_client
    @fire_cloud_profile = FireCloudProfile.new(profile_params)
    begin
      if @fire_cloud_profile.valid?
        @client.set_profile(profile_params)
        @notice = "Your FireCloud profile has been successfully updated."
        redirect_to admin_configurations_path, notice: "The Unity service account for #{@client.issuer} FireCloud profile has been successfully updated."
      else
        logger.info "Error in updating FireCloud profile for #{@client.issuer}: #{@fire_cloud_profile.errors.full_messages}"
        respond_to do |format|
          format.html { render :get_service_account_profile, status: :unprocessable_entity}
          format.json { render @fire_cloud_profile.errors, status: :unprocessable_entity}
        end
      end
    rescue => e
      logger.error "#{Time.now}: unable to update Unity service account for #{@client.issuer} FireCloud registration: #{e.message}"
      @alert = "Unable to update The Unity service account for #{@client.issuer} FireCloud profile: #{e.message}"
    end
  end
def update_service_account_profile @client = params [ :account ] == 'gcs_admin' ? ApplicationController . gcs_client : ApplicationController . fire_cloud_client @fire_cloud_profile = FireCloudProfile . new ( profile_params ) begin if @fire_cloud_profile . valid? @client . set_profile ( profile_params ) @notice = "Your FireCloud profile has been successfully updated." redirect_to admin_configurations_path , notice : "The Unity service account for #{@client.issuer} FireCloud profile has been successfully updated." else logger . info "Error in updating FireCloud profile for #{@client.issuer}: #{@fire_cloud_profile.errors.full_messages}" respond_to do | format | format . html { render :get_service_account_profile , status : :unprocessable_entity } format . json { render @fire_cloud_profile . errors , status : :unprocessable_entity } end end rescue => e logger . error "#{Time.now}: unable to update Unity service account for #{@client.issuer} FireCloud registration: #{e.message}" @alert = "Unable to update The Unity service account for #{@client.issuer} FireCloud profile: #{e.message}" end end
register or update the FireCloud profile of the portal service account
register or update the FireCloud profile of the portal service account