feat(xo-server-auth-saml): support multiline cert (#6403)

Fixes https://xcp-ng.org/forum/topic/6174/saml-auth-with-azure-ad/10
This commit is contained in:
Mathieu 2022-09-06 10:55:02 +02:00 committed by GitHub
parent e69ae7b0db
commit 243bffebbd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 3 deletions

View File

@ -11,6 +11,8 @@
> Users must be able to say: “I had this issue, happy to know it's fixed”
- [Plugin/auth-saml] Certificate input support multiline (PR [#6403](https://github.com/vatesfr/xen-orchestra/pull/6403))
### Packages to release
> When modifying a package, add it here with its release type.
@ -27,4 +29,8 @@
<!--packages-start-->
- xo-server-auth-saml patch
- xo-server patch
- xo-web patch
<!--packages-end-->

View File

@ -17,6 +17,7 @@ export const configurationSchema = {
type: 'string',
},
cert: {
$multiline: true,
title: 'Certificate',
description: "Copy/paste the identity provider's certificate",
type: 'string',

View File

@ -16,7 +16,7 @@ export default class {
this._ajv = new Ajv({
strict: 'log',
useDefaults: true,
}).addVocabulary(['$type', 'enumNames'])
}).addVocabulary(['$multiline', '$type', 'enumNames'])
this._plugins = { __proto__: null }
this._pluginsMetadata = new PluginsMetadata({

View File

@ -15,6 +15,7 @@ export default class Combobox extends Component {
options: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.objectOf(PropTypes.string)]),
onChange: PropTypes.func.isRequired,
value: PropTypes.string.isRequired,
multiline: PropTypes.bool,
}
_handleChange = event => {
@ -26,11 +27,11 @@ export default class Combobox extends Component {
}
render() {
const { options, ...props } = this.props
const { options, multiline = false, ...props } = this.props
props.className = 'form-control'
props.onChange = this._handleChange
const Input = <input {...props} />
const Input = multiline ? <textarea {...props} /> : <input {...props} />
if (isEmpty(options)) {
return Input

View File

@ -33,6 +33,7 @@ export default class StringInput extends Component {
<Combobox
value={value !== undefined ? value : ''}
disabled={disabled}
multiline={schema.$multiline}
onChange={this._onChange}
options={schema.defaults}
placeholder={placeholder || schema.default}