6 UI configuration for example authentication plugin.
8 This file provides the configuration interface for the auth plugin
9 in System > Plugins. It defines the plugin metadata and configuration
10 options that will be stored in the luci_plugins UCI config.
12 The filename must match the backend plugin UUID (32-char hex).
15 return baseclass.extend({
16 // Plugin classification
18 class_i18n: _('Authentication'),
21 type_i18n: _('Login'),
24 name: 'Example Auth Plugin',
25 id: 'd0ecde1b009d44ff82faa8b0ff219cef',
26 title: _('Example Authentication Plugin'),
27 description: _('A simple example authentication plugin that demonstrates the auth plugin interface. ' +
28 'This plugin adds a verification code challenge after password login.'),
30 // Add configuration form options
34 o = s.option(form.Flag, 'enabled', _('Enabled'));
35 o.default = o.disabled;
38 o = s.option(form.Value, 'priority', _('Priority'),
39 _('Execution order. Lower values run first.'));
41 o.datatype = 'integer';
42 o.depends('enabled', '1');
44 o = s.option(form.Value, 'challenge_field', _('Challenge Field Name'),
45 _('The form field name for the verification code input.'));
46 o.default = 'verification_code';
48 o.depends('enabled', '1');
50 o = s.option(form.Value, 'help_text', _('Help Text'),
51 _('Text displayed to help users understand what to enter.'));
52 o.default = 'Enter your verification code';
53 o.depends('enabled', '1');
55 o = s.option(form.Value, 'test_code', _('Test Code'),
56 _('For demonstration purposes, the expected verification code. ' +
57 'In a real plugin, this would integrate with TOTP/SMS/WebAuthn systems.'));
60 o.depends('enabled', '1');
63 // Display current configuration summary
64 configSummary(section) {
65 if (section.enabled != '1')
68 const challenge_field = section.challenge_field || 'verification_code';
69 const help_text = section.help_text || 'Enter your verification code';
71 return _('Field: %s - %s').format(challenge_field, help_text);