Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 2 additions & 28 deletions frontend/public/components/cluster-settings/htpasswd-idp-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ const DroppableFileInput = (props) => <AsyncComponent loader={() => import('../u
export class AddHTPasswdPage extends PromiseComponent {
readonly state: AddHTPasswdPageState = {
name: 'htpasswd',
challenge: true,
login: true,
mappingMethod: 'claim',
htpasswdFileContent: '',
inProgress: false,
Expand Down Expand Up @@ -52,12 +50,10 @@ export class AddHTPasswdPage extends PromiseComponent {
}

addHTPasswdIDP(oauth: K8sResourceKind, secretName: string): Promise<K8sResourceKind> {
const { name, challenge, login, mappingMethod } = this.state;
const { name, mappingMethod } = this.state;
const htpasswd = {
name,
type: 'HTPasswd',
challenge,
login,
mappingMethod,
htpasswd: {
fileData: {
Expand Down Expand Up @@ -94,14 +90,6 @@ export class AddHTPasswdPage extends PromiseComponent {
this.setState({name: e.currentTarget.value});
};

loginChanged: React.ReactEventHandler<HTMLInputElement> = event => {
this.setState({login: event.currentTarget.checked});
}

challengeChanged: React.ReactEventHandler<HTMLInputElement> = event => {
this.setState({challenge: event.currentTarget.checked});
}

mappingMethodChanged = (mappingMethod: string) => {
this.setState({mappingMethod});
}
Expand All @@ -111,7 +99,7 @@ export class AddHTPasswdPage extends PromiseComponent {
};

render() {
const { name, login, challenge, mappingMethod, htpasswdFileContent } = this.state;
const { name, mappingMethod, htpasswdFileContent } = this.state;
const title = 'Add Identity Provider: HTPasswd';
const mappingMethods = {
'claim': 'Claim',
Expand Down Expand Up @@ -140,18 +128,6 @@ export class AddHTPasswdPage extends PromiseComponent {
Unique name of the new identity provider. This cannot be changed later.
</p>
</div>
<div className="checkbox">
<label className="control-label">
<input type="checkbox" onChange={this.loginChanged} checked={login} />
Use this identity provider for browser login
</label>
</div>
<div className="checkbox">
<label className="control-label">
<input type="checkbox" onChange={this.challengeChanged} checked={challenge} />
Issue <code>WWW-Authenticate</code> challenges to non-browser clients
</label>
</div>
<div className="form-group">
<label className="control-label co-required" htmlFor="tag">Mapping Method</label>
<Dropdown dropDownClassName="dropdown--full-width" items={mappingMethods} selectedKey={mappingMethod} title={mappingMethods[mappingMethod]} onChange={this.mappingMethodChanged} />
Expand Down Expand Up @@ -181,8 +157,6 @@ export class AddHTPasswdPage extends PromiseComponent {

type AddHTPasswdPageState = {
name: string;
login: boolean;
challenge: boolean;
mappingMethod: string;
htpasswdFileContent: string;
inProgress: boolean;
Expand Down
6 changes: 2 additions & 4 deletions frontend/public/components/cluster-settings/oauth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,15 @@ const IdentityProviders: React.SFC<IdentityProvidersProps> = ({identityProviders
<tr>
<th>Name</th>
<th>Type</th>
<th>Challenge</th>
<th>Login</th>
<th>Mapping Method</th>
</tr>
</thead>
<tbody>
{_.map(identityProviders, idp => (
<tr key={idp.name}>
<td>{idp.name}</td>
<td>{idp.type}</td>
<td>{idp.challenge ? 'true' : 'false'}</td>
<td>{idp.login ? 'true' : 'false'}</td>
<td>{idp.mappingMethod || 'claim'}</td>
</tr>
))}
</tbody>
Expand Down