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 (+152 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
=cut
71
72
__PACKAGE__->add_columns(
73
  "identity_provider_hostname_id",
74
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
75
  "hostname_id",
76
  { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
77
  "identity_provider_id",
78
  { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
79
  "is_enabled",
80
  { data_type => "tinyint", default_value => 1, is_nullable => 0 },
81
  "force_sso",
82
  { data_type => "tinyint", default_value => 0, is_nullable => 0 },
83
);
84
85
=head1 PRIMARY KEY
86
87
=over 4
88
89
=item * L</identity_provider_hostname_id>
90
91
=back
92
93
=cut
94
95
__PACKAGE__->set_primary_key("identity_provider_hostname_id");
96
97
=head1 UNIQUE CONSTRAINTS
98
99
=head2 C<hostname_id_provider>
100
101
=over 4
102
103
=item * L</hostname_id>
104
105
=item * L</identity_provider_id>
106
107
=back
108
109
=cut
110
111
__PACKAGE__->add_unique_constraint(
112
  "hostname_id_provider",
113
  ["hostname_id", "identity_provider_id"],
114
);
115
116
=head1 RELATIONS
117
118
=head2 hostname
119
120
Type: belongs_to
121
122
Related object: L<Koha::Schema::Result::Hostname>
123
124
=cut
125
126
__PACKAGE__->belongs_to(
127
  "hostname",
128
  "Koha::Schema::Result::Hostname",
129
  { hostname_id => "hostname_id" },
130
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" },
131
);
132
133
=head2 identity_provider
134
135
Type: belongs_to
136
137
Related object: L<Koha::Schema::Result::IdentityProvider>
138
139
=cut
140
141
__PACKAGE__->belongs_to(
142
  "identity_provider",
143
  "Koha::Schema::Result::IdentityProvider",
144
  { identity_provider_id => "identity_provider_id" },
145
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" },
146
);
147
148
149
# Created by DBIx::Class::Schema::Loader v0.07051 @ 2026-02-21 07:16:46
150
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:K31ZTdC8ZmSuuKPACLnrUQ
151
152
1;
(-)a/Koha/Schema/Result/IdentityProviderMapping.pm (-1 / +140 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
=head2 is_matchpoint
67
68
  data_type: 'tinyint'
69
  default_value: 0
70
  is_nullable: 0
71
72
Use this field to match existing patrons
73
74
=cut
75
76
__PACKAGE__->add_columns(
77
  "mapping_id",
78
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
79
  "identity_provider_id",
80
  { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
81
  "provider_field",
82
  { data_type => "varchar", is_nullable => 1, size => 255 },
83
  "koha_field",
84
  { data_type => "varchar", is_nullable => 0, size => 255 },
85
  "default_content",
86
  { data_type => "varchar", is_nullable => 1, size => 255 },
87
  "is_matchpoint",
88
  { data_type => "tinyint", default_value => 0, is_nullable => 0 },
89
);
90
91
=head1 PRIMARY KEY
92
93
=over 4
94
95
=item * L</mapping_id>
96
97
=back
98
99
=cut
100
101
__PACKAGE__->set_primary_key("mapping_id");
102
103
=head1 UNIQUE CONSTRAINTS
104
105
=head2 C<provider_koha_field>
106
107
=over 4
108
109
=item * L</identity_provider_id>
110
111
=item * L</koha_field>
112
113
=back
114
115
=cut
116
117
__PACKAGE__->add_unique_constraint("provider_koha_field", ["identity_provider_id", "koha_field"]);
118
119
=head1 RELATIONS
120
121
=head2 identity_provider
122
123
Type: belongs_to
124
125
Related object: L<Koha::Schema::Result::IdentityProvider>
126
127
=cut
128
129
__PACKAGE__->belongs_to(
130
  "identity_provider",
131
  "Koha::Schema::Result::IdentityProvider",
132
  { identity_provider_id => "identity_provider_id" },
133
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" },
134
);
135
136
137
# Created by DBIx::Class::Schema::Loader v0.07051 @ 2026-02-20 10:20:26
138
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:x2JmD4As/a96Ndoe5rzuKg
139
140
1;

Return to bug 39224