John Cowen 78e9c0d2d9
ui: Ensure the partition is passed through to the request for the SSO auth URL (#11979)
* Make sure the mocks reflect the requested partition/namespace

* Ensure partition is passed through to the HTTP adapter

* Pass AuthMethod object through to TokenSource in order to use Partition

* Change up docs and add potential improvements for future

* Pass the query partition back onto the response

* Make sure the OIDC callback mock returns a Partition

* Enable OIDC provider mock overwriting during acceptance testing

* Make sure we can enable partitions and SSO post bootup only required

...for now

* Wire up oidc provider mocking

* Add SSO full auth flow acceptance tests
2022-01-11 11:02:46 +00:00

22 lines
772 B
JavaScript

export default function(scenario, respondWith, set, oidc) {
// respondWith should set the url to return a certain response shape
scenario
.given(['the url "$endpoint" responds with a $status status'], function(url, status) {
respondWith(url, {
status: parseInt(status),
});
})
.given(['the url "$endpoint" responds with from yaml\n$yaml'], function(url, data) {
if (typeof data.body !== 'string') {
data.body = JSON.stringify(data.body);
}
respondWith(url, data);
})
.given(['the "$provider" oidcProvider responds with from yaml\n$yaml'], function(name, data) {
oidc(name, data);
})
.given('a network latency of $number', function(number) {
set('CONSUL_LATENCY', number);
});
}