Class: AtlasRb::Reset

Inherits:
Object
  • Object
show all
Extended by:
FaradayHelper
Defined in:
lib/atlas_rb.rb

Overview

Test-environment helper that wipes Atlas state via GET /reset.

Do not call against production. This exists so RSpec suites running against a disposable Atlas instance can return to a clean baseline between examples.

Constant Summary

Constants included from FaradayHelper

FaradayHelper::ASSERTION_AUDIENCE, FaradayHelper::ASSERTION_ISSUER, FaradayHelper::ASSERTION_TTL

Class Method Summary collapse

Methods included from FaradayHelper

connection, multipart, system_connection

Class Method Details

.clean(nuid: nil, on_behalf_of: nil) ⇒ String?

Reset the connected Atlas instance to a clean state.

Examples:

AtlasRb::Reset.clean(nuid: "000000000")

Parameters:

  • nuid (String, nil) (defaults to: nil)

    optional acting user's NUID. On the relay-signing path it is signed into the assertion sub; on the BYO-JWT (ATLAS_JWT) path it is ignored (identity lives in the token). Atlas's MaintenanceController#reset runs through the standard require_auth filter like any other endpoint.

  • on_behalf_of (String, nil) (defaults to: nil)

    optional NUID for the On-Behalf-Of header. Falls through to AtlasRb.config.default_on_behalf_of when omitted.

Returns:

  • (String, nil)

    the raw response body from GET /reset.



138
139
140
# File 'lib/atlas_rb.rb', line 138

def self.clean(nuid: nil, on_behalf_of: nil)
  connection({}, nuid, on_behalf_of: on_behalf_of).get("/reset")&.body
end