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

61 lines
1.6 KiB
Handlebars

<StateChart
@src={{this.chart}}
@initial={{if (eq @type 'oidc') 'provider' 'secret'}}
as |State Guard Action dispatch state|>
<Guard
@name="isSecret"
@cond={{this.isSecret}}
/>
{{#let
(uri '/${partition}/${nspace}/${dc}'
(hash
partition=(or @value.Partition @partition)
nspace=(or @value.Namespace @nspace)
dc=@dc
)
)
as |path|}}
<State @matches="secret">
<DataSource
@src={{uri (concat path '/token/self/${value}')
(hash
value=@value
)
}}
@onchange={{this.change}}
@onerror={{@onerror}}
/>
</State>
<State @matches="provider">
<DataSource
@src={{uri (concat path '/oidc/provider/${value}')
(hash
value=@value.Name
)
}}
@onchange={{queue (action (mut this.provider) value="data") (action dispatch "SUCCESS")}}
@onerror={{@onerror}}
/>
</State>
<State @matches="jwt">
<JwtSource
@src={{this.provider.AuthURL}}
@onchange={{queue (action (mut this.jwt) value="data") (action dispatch "SUCCESS")}}
@onerror={{@onerror}}
/>
</State>
<State @matches="token">
<DataSource
@src={{uri (concat path '/oidc/authorize/${provider}/${code}/${state}')
(hash
provider=this.provider.Name
code=this.jwt.authorizationCode
state=(or this.jwt.authorizationState '')
)
}}
@onchange={{this.change}}
@onerror={{@onerror}}
/>
</State>
{{/let}}
</StateChart>