LDAP と FreeIPA の拡張

LDAP と FreeIPA の拡張

私は FreeIPA を使用しており、その属性を正常に拡張しましたが、FreeIPA に追加された Python プラグインの検証機能は、コマンド ラインから入力された値に対してのみ機能することに気付きました。Web UI から入力された値は、検証されずにそのまま保存されます。

したがって、サーバーに次の変更を追加することを考えていました。

  1. FreeIPA Web UI を有効にして、属性値を保存する前に検証します。
  2. LDAP で使用される新しい構文タイプ (血液型の構文など) を作成します。
  3. Web UI の属性のテキスト ボックスをドロップダウン リストに変更します。

答え1

  1. WebUI がユーザー入力を検証できるようにするには、FreeIPA Python プラグインの検証機能によって検証を実行できるため、これは必要ありません (変更を有効にするには、サーバーを再起動するだけで済みます)。
  2. 新しい構文を作成する必要はありません。検証プロセスの代わりとしてそれが必要でしたが、動作しているので必要ありません。
  3. 属性フィールドのタイプを変更するには、JavaScript ファイルで新しい属性フィールドを作成するときに「$type」を追加する必要があります。

テキストエリアを作成します。

section.fields.push({
     $type:'textarea',
     name: 'ldap_attribute_name',
     label: 'some label name'
});

ドロップダウンメニューを作成します。

section.fields.push({
     $type:'entity_select',
     other_entity:'user',         // get the users list
     other_field:'uid',           // get the user IDs and display them in the list
     name: 'ldap_attribute_name',
     label: 'some label name'
});

ラジオボタンを作成します。

section.fields.push({
     $type:'radio',
     options:[          // create the new radio buttons
       {label:'first button label',value:'first button value'},
       {label:'second button label',value:'second button value'}
     ],
     name: 'ldap_attribute_name',
     label: 'some label name'
});

ファイルを詳しく調べることで、さらに多くのオプションを確認できます/usr/share/ipa/ui/js/freeipa/app.js

関連情報