View | Details | Raw Unified | Return to bug 39224
Collapse All | Expand All

(-)a/Koha/Schema/Result/Hostname.pm (+98 lines)
Line 0 Link Here
1
use utf8;
2
package Koha::Schema::Result::Hostname;
3
4
# Created by DBIx::Class::Schema::Loader
5
# DO NOT MODIFY THE FIRST PART OF THIS FILE
6
7
=head1 NAME
8
9
Koha::Schema::Result::Hostname - Canonical hostname registry for identity provider selection
10
11
=cut
12
13
use strict;
14
use warnings;
15
16
use base 'DBIx::Class::Core';
17
18
=head1 TABLE: C<hostnames>
19
20
=cut
21
22
__PACKAGE__->table("hostnames");
23
24
=head1 ACCESSORS
25
26
=head2 hostname_id
27
28
  data_type: 'integer'
29
  is_auto_increment: 1
30
  is_nullable: 0
31
32
Unique identifier for this hostname
33
34
=head2 hostname
35
36
  data_type: 'varchar'
37
  is_nullable: 0
38
  size: 255
39
40
Server hostname string
41
42
=cut
43
44
__PACKAGE__->add_columns(
45
  "hostname_id",
46
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
47
  "hostname",
48
  { data_type => "varchar", is_nullable => 0, size => 255 },
49
);
50
51
=head1 PRIMARY KEY
52
53
=over 4
54
55
=item * L</hostname_id>
56
57
=back
58
59
=cut
60
61
__PACKAGE__->set_primary_key("hostname_id");
62
63
=head1 UNIQUE CONSTRAINTS
64
65
=head2 C<hostname>
66
67
=over 4
68
69
=item * L</hostname>
70
71
=back
72
73
=cut
74
75
__PACKAGE__->add_unique_constraint("hostname", ["hostname"]);
76
77
=head1 RELATIONS
78
79
=head2 identity_provider_hostnames
80
81
Type: has_many
82
83
Related object: L<Koha::Schema::Result::IdentityProviderHostname>
84
85
=cut
86
87
__PACKAGE__->has_many(
88
  "identity_provider_hostnames",
89
  "Koha::Schema::Result::IdentityProviderHostname",
90
  { "foreign.hostname_id" => "self.hostname_id" },
91
  { cascade_copy => 0, cascade_delete => 0 },
92
);
93
94
95
# Created by DBIx::Class::Schema::Loader v0.07051 @ 2026-02-20 10:20:26
96
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:uvzH69NxZ1akNcfsvgRDIg
97
98
1;
(-)a/Koha/Schema/Result/IdentityProvider.pm (-23 / +40 lines)
Lines 50-56 Description for the provider Link Here
50
=head2 protocol
50
=head2 protocol
51
51
52
  data_type: 'enum'
52
  data_type: 'enum'
53
  extra: {list => ["OAuth","OIDC","LDAP","CAS"]}
53
  extra: {list => ["OAuth","OIDC","SAML2"]}
54
  is_nullable: 0
54
  is_nullable: 0
55
55
56
Protocol provider speaks
56
Protocol provider speaks
Lines 62-81 Protocol provider speaks Link Here
62
62
63
Configuration of the provider in JSON format
63
Configuration of the provider in JSON format
64
64
65
=head2 mapping
65
=head2 enabled
66
66
67
  data_type: 'longtext'
67
  data_type: 'tinyint'
68
  default_value: 1
68
  is_nullable: 0
69
  is_nullable: 0
69
70
70
Configuration to map provider data to Koha user
71
Whether this provider is active
71
72
=head2 matchpoint
73
74
  data_type: 'enum'
75
  extra: {list => ["email","userid","cardnumber"]}
76
  is_nullable: 0
77
78
The patron attribute to be used as matchpoint
79
72
80
=head2 icon_url
73
=head2 icon_url
81
74
Lines 97-115 __PACKAGE__->add_columns( Link Here
97
  "protocol",
90
  "protocol",
98
  {
91
  {
99
    data_type => "enum",
92
    data_type => "enum",
100
    extra => { list => ["OAuth", "OIDC", "LDAP", "CAS"] },
93
    extra => { list => ["OAuth", "OIDC", "SAML2"] },
101
    is_nullable => 0,
94
    is_nullable => 0,
102
  },
95
  },
103
  "config",
96
  "config",
104
  { data_type => "longtext", is_nullable => 0 },
97
  { data_type => "longtext", is_nullable => 0 },
105
  "mapping",
98
  "enabled",
106
  { data_type => "longtext", is_nullable => 0 },
99
  { data_type => "tinyint", default_value => 1, is_nullable => 0 },
107
  "matchpoint",
108
  {
109
    data_type => "enum",
110
    extra => { list => ["email", "userid", "cardnumber"] },
111
    is_nullable => 0,
112
  },
113
  "icon_url",
100
  "icon_url",
114
  { data_type => "varchar", is_nullable => 1, size => 255 },
101
  { data_type => "varchar", is_nullable => 1, size => 255 },
115
);
102
);
Lines 157-165 __PACKAGE__->has_many( Link Here
157
  { cascade_copy => 0, cascade_delete => 0 },
144
  { cascade_copy => 0, cascade_delete => 0 },
158
);
145
);
159
146
147
=head2 identity_provider_hostnames
148
149
Type: has_many
150
151
Related object: L<Koha::Schema::Result::IdentityProviderHostname>
152
153
=cut
154
155
__PACKAGE__->has_many(
156
  "identity_provider_hostnames",
157
  "Koha::Schema::Result::IdentityProviderHostname",
158
  { "foreign.identity_provider_id" => "self.identity_provider_id" },
159
  { cascade_copy => 0, cascade_delete => 0 },
160
);
161
162
=head2 identity_provider_mappings
163
164
Type: has_many
165
166
Related object: L<Koha::Schema::Result::IdentityProviderMapping>
167
168
=cut
169
170
__PACKAGE__->has_many(
171
  "identity_provider_mappings",
172
  "Koha::Schema::Result::IdentityProviderMapping",
173
  { "foreign.identity_provider_id" => "self.identity_provider_id" },
174
  { cascade_copy => 0, cascade_delete => 0 },
175
);
176
160
177
161
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-11-10 13:01:32
178
# Created by DBIx::Class::Schema::Loader v0.07051 @ 2026-02-21 07:16:46
162
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xSD/bRC3hJCF+nP/EYwn3Q
179
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:4T1F2ggwQdvVV7jskMZwig
163
180
164
__PACKAGE__->has_many(
181
__PACKAGE__->has_many(
165
  "domains",
182
  "domains",
(-)a/Koha/Schema/Result/IdentityProviderDomain.pm (-2 / +12 lines)
Lines 105-110 Allow user auto register (OPAC) Link Here
105
105
106
Allow user auto register (Staff interface)
106
Allow user auto register (Staff interface)
107
107
108
=head2 send_welcome_email
109
110
  data_type: 'tinyint'
111
  default_value: 0
112
  is_nullable: 0
113
114
Send welcome email to patron on first login
115
108
=cut
116
=cut
109
117
110
__PACKAGE__->add_columns(
118
__PACKAGE__->add_columns(
Lines 128-133 __PACKAGE__->add_columns( Link Here
128
  { data_type => "tinyint", default_value => 0, is_nullable => 0 },
136
  { data_type => "tinyint", default_value => 0, is_nullable => 0 },
129
  "auto_register_staff",
137
  "auto_register_staff",
130
  { data_type => "tinyint", default_value => 0, is_nullable => 0 },
138
  { data_type => "tinyint", default_value => 0, is_nullable => 0 },
139
  "send_welcome_email",
140
  { data_type => "tinyint", default_value => 0, is_nullable => 0 },
131
);
141
);
132
142
133
=head1 PRIMARY KEY
143
=head1 PRIMARY KEY
Lines 216-223 __PACKAGE__->belongs_to( Link Here
216
);
226
);
217
227
218
228
219
# Created by DBIx::Class::Schema::Loader v0.07051 @ 2024-08-22 18:15:05
229
# Created by DBIx::Class::Schema::Loader v0.07051 @ 2026-02-21 07:16:46
220
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GpRUQgJ3WUt9nAAS0E9qWw
230
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7M7qCu+9WGNjvvaqxyL6Aw
221
231
222
__PACKAGE__->add_columns(
232
__PACKAGE__->add_columns(
223
    '+auto_register_opac'  => { is_boolean => 1 },
233
    '+auto_register_opac'  => { is_boolean => 1 },
(-)a/Koha/Schema/Result/IdentityProviderHostname.pm (+162 lines)
Line 0 Link Here
1
use utf8;
2
package Koha::Schema::Result::IdentityProviderHostname;
3
4
# Created by DBIx::Class::Schema::Loader
5
# DO NOT MODIFY THE FIRST PART OF THIS FILE
6
7
=head1 NAME
8
9
Koha::Schema::Result::IdentityProviderHostname
10
11
=head1 DESCRIPTION
12
13
Maps server hostnames to identity providers (many-to-many). A hostname may be linked to multiple providers.
14
15
=cut
16
17
use strict;
18
use warnings;
19
20
use base 'DBIx::Class::Core';
21
22
=head1 TABLE: C<identity_provider_hostnames>
23
24
=cut
25
26
__PACKAGE__->table("identity_provider_hostnames");
27
28
=head1 ACCESSORS
29
30
=head2 identity_provider_hostname_id
31
32
  data_type: 'integer'
33
  is_auto_increment: 1
34
  is_nullable: 0
35
36
unique key, used to identify the hostname entry
37
38
=head2 hostname_id
39
40
  data_type: 'integer'
41
  is_foreign_key: 1
42
  is_nullable: 0
43
44
FK to hostnames table
45
46
=head2 identity_provider_id
47
48
  data_type: 'integer'
49
  is_foreign_key: 1
50
  is_nullable: 0
51
52
Identity provider associated with this hostname
53
54
=head2 is_enabled
55
56
  data_type: 'tinyint'
57
  default_value: 1
58
  is_nullable: 0
59
60
Whether this hostname is active for this provider
61
62
=head2 force_sso
63
64
  data_type: 'tinyint'
65
  default_value: 0
66
  is_nullable: 0
67
68
Force SSO redirect for users on this hostname
69
70
=head2 matchpoint
71
72
  data_type: 'varchar'
73
  is_nullable: 1
74
  size: 255
75
76
Koha field used to match incoming users against existing patrons
77
78
=cut
79
80
__PACKAGE__->add_columns(
81
  "identity_provider_hostname_id",
82
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
83
  "hostname_id",
84
  { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
85
  "identity_provider_id",
86
  { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
87
  "is_enabled",
88
  { data_type => "tinyint", default_value => 1, is_nullable => 0 },
89
  "force_sso",
90
  { data_type => "tinyint", default_value => 0, is_nullable => 0 },
91
  "matchpoint",
92
  { data_type => "varchar", is_nullable => 1, size => 255 },
93
);
94
95
=head1 PRIMARY KEY
96
97
=over 4
98
99
=item * L</identity_provider_hostname_id>
100
101
=back
102
103
=cut
104
105
__PACKAGE__->set_primary_key("identity_provider_hostname_id");
106
107
=head1 UNIQUE CONSTRAINTS
108
109
=head2 C<hostname_id_provider>
110
111
=over 4
112
113
=item * L</hostname_id>
114
115
=item * L</identity_provider_id>
116
117
=back
118
119
=cut
120
121
__PACKAGE__->add_unique_constraint(
122
  "hostname_id_provider",
123
  ["hostname_id", "identity_provider_id"],
124
);
125
126
=head1 RELATIONS
127
128
=head2 hostname
129
130
Type: belongs_to
131
132
Related object: L<Koha::Schema::Result::Hostname>
133
134
=cut
135
136
__PACKAGE__->belongs_to(
137
  "hostname",
138
  "Koha::Schema::Result::Hostname",
139
  { hostname_id => "hostname_id" },
140
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" },
141
);
142
143
=head2 identity_provider
144
145
Type: belongs_to
146
147
Related object: L<Koha::Schema::Result::IdentityProvider>
148
149
=cut
150
151
__PACKAGE__->belongs_to(
152
  "identity_provider",
153
  "Koha::Schema::Result::IdentityProvider",
154
  { identity_provider_id => "identity_provider_id" },
155
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" },
156
);
157
158
159
# Created by DBIx::Class::Schema::Loader v0.07051 @ 2026-02-21 07:16:46
160
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:K31ZTdC8ZmSuuKPACLnrUQ
161
162
1;
(-)a/Koha/Schema/Result/IdentityProviderMapping.pm (-1 / +129 lines)
Line 0 Link Here
0
- 
1
use utf8;
2
package Koha::Schema::Result::IdentityProviderMapping;
3
4
# Created by DBIx::Class::Schema::Loader
5
# DO NOT MODIFY THE FIRST PART OF THIS FILE
6
7
=head1 NAME
8
9
Koha::Schema::Result::IdentityProviderMapping
10
11
=cut
12
13
use strict;
14
use warnings;
15
16
use base 'DBIx::Class::Core';
17
18
=head1 TABLE: C<identity_provider_mappings>
19
20
=cut
21
22
__PACKAGE__->table("identity_provider_mappings");
23
24
=head1 ACCESSORS
25
26
=head2 mapping_id
27
28
  data_type: 'integer'
29
  is_auto_increment: 1
30
  is_nullable: 0
31
32
primary key
33
34
=head2 identity_provider_id
35
36
  data_type: 'integer'
37
  is_foreign_key: 1
38
  is_nullable: 0
39
40
Reference to identity provider
41
42
=head2 provider_field
43
44
  data_type: 'varchar'
45
  is_nullable: 1
46
  size: 255
47
48
Attribute name from the identity provider
49
50
=head2 koha_field
51
52
  data_type: 'varchar'
53
  is_nullable: 0
54
  size: 255
55
56
Corresponding field in Koha borrowers table
57
58
=head2 default_content
59
60
  data_type: 'varchar'
61
  is_nullable: 1
62
  size: 255
63
64
Default value if provider does not supply this field
65
66
=cut
67
68
__PACKAGE__->add_columns(
69
  "mapping_id",
70
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
71
  "identity_provider_id",
72
  { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
73
  "provider_field",
74
  { data_type => "varchar", is_nullable => 1, size => 255 },
75
  "koha_field",
76
  { data_type => "varchar", is_nullable => 0, size => 255 },
77
  "default_content",
78
  { data_type => "varchar", is_nullable => 1, size => 255 },
79
);
80
81
=head1 PRIMARY KEY
82
83
=over 4
84
85
=item * L</mapping_id>
86
87
=back
88
89
=cut
90
91
__PACKAGE__->set_primary_key("mapping_id");
92
93
=head1 UNIQUE CONSTRAINTS
94
95
=head2 C<provider_koha_field>
96
97
=over 4
98
99
=item * L</identity_provider_id>
100
101
=item * L</koha_field>
102
103
=back
104
105
=cut
106
107
__PACKAGE__->add_unique_constraint("provider_koha_field", ["identity_provider_id", "koha_field"]);
108
109
=head1 RELATIONS
110
111
=head2 identity_provider
112
113
Type: belongs_to
114
115
Related object: L<Koha::Schema::Result::IdentityProvider>
116
117
=cut
118
119
__PACKAGE__->belongs_to(
120
  "identity_provider",
121
  "Koha::Schema::Result::IdentityProvider",
122
  { identity_provider_id => "identity_provider_id" },
123
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" },
124
);
125
126
127
# Created by DBIx::Class::Schema::Loader v0.07051 @ 2026-02-20 10:20:26
128
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:x2JmD4As/a96Ndoe5rzuKg
129
1;

Return to bug 39224