Bug 31378: Add an administration interface for authentication sources
[koha.git] / Koha / Schema / Result / AuthProvider.pm
1 use utf8;
2 package Koha::Schema::Result::AuthProvider;
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::AuthProvider
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<auth_providers>
19
20 =cut
21
22 __PACKAGE__->table("auth_providers");
23
24 =head1 ACCESSORS
25
26 =head2 auth_provider_id
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 unique key, used to identify the provider
33
34 =head2 code
35
36   data_type: 'varchar'
37   is_nullable: 0
38   size: 20
39
40 Provider code
41
42 =head2 description
43
44   data_type: 'varchar'
45   is_nullable: 0
46   size: 255
47
48 Description for the provider
49
50 =head2 protocol
51
52   data_type: 'enum'
53   extra: {list => ["OAuth","OIDC","LDAP","CAS"]}
54   is_nullable: 0
55
56 Protocol provider speaks
57
58 =head2 config
59
60   data_type: 'longtext'
61   default_value: ''{}''
62   is_nullable: 0
63
64 Configuration of the provider in JSON format
65
66 =head2 mapping
67
68   data_type: 'longtext'
69   default_value: ''{}''
70   is_nullable: 0
71
72 Configuration to map provider data to Koha user
73
74 =head2 matchpoint
75
76   data_type: 'enum'
77   extra: {list => ["email","userid","cardnumber"]}
78   is_nullable: 0
79
80 The patron attribute to be used as matchpoint
81
82 =head2 icon_url
83
84   data_type: 'varchar'
85   is_nullable: 1
86   size: 255
87
88 Provider icon URL
89
90 =cut
91
92 __PACKAGE__->add_columns(
93   "auth_provider_id",
94   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
95   "code",
96   { data_type => "varchar", is_nullable => 0, size => 20 },
97   "description",
98   { data_type => "varchar", is_nullable => 0, size => 255 },
99   "protocol",
100   {
101     data_type => "enum",
102     extra => { list => ["OAuth", "OIDC", "LDAP", "CAS"] },
103     is_nullable => 0,
104   },
105   "config",
106   { data_type => "longtext", default_value => "'{}'", is_nullable => 0 },
107   "mapping",
108   { data_type => "longtext", default_value => "'{}'", is_nullable => 0 },
109   "matchpoint",
110   {
111     data_type => "enum",
112     extra => { list => ["email", "userid", "cardnumber"] },
113     is_nullable => 0,
114   },
115   "icon_url",
116   { data_type => "varchar", is_nullable => 1, size => 255 },
117 );
118
119 =head1 PRIMARY KEY
120
121 =over 4
122
123 =item * L</auth_provider_id>
124
125 =back
126
127 =cut
128
129 __PACKAGE__->set_primary_key("auth_provider_id");
130
131 =head1 UNIQUE CONSTRAINTS
132
133 =head2 C<code>
134
135 =over 4
136
137 =item * L</code>
138
139 =back
140
141 =cut
142
143 __PACKAGE__->add_unique_constraint("code", ["code"]);
144
145 =head1 RELATIONS
146
147 =head2 auth_provider_domains
148
149 Type: has_many
150
151 Related object: L<Koha::Schema::Result::AuthProviderDomain>
152
153 =cut
154
155 __PACKAGE__->has_many(
156   "auth_provider_domains",
157   "Koha::Schema::Result::AuthProviderDomain",
158   { "foreign.auth_provider_id" => "self.auth_provider_id" },
159   { cascade_copy => 0, cascade_delete => 0 },
160 );
161
162
163 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-09-30 19:43:00
164 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZqUo3by0ZXca5RI3QFNypw
165
166
167 =head2 domains
168
169 Type: has_many
170
171 Related object: L<Koha::Schema::Result::AuthProviderDomain>
172
173 =cut
174
175 __PACKAGE__->has_many(
176   "domains",
177   "Koha::Schema::Result::AuthProviderDomain",
178   { "foreign.auth_provider_id" => "self.auth_provider_id" },
179   { cascade_copy => 0, cascade_delete => 0 },
180 );
181
182 sub koha_object_class {
183     'Koha::Auth::Provider';
184 }
185 sub koha_objects_class {
186     'Koha::Auth::Providers';
187 }
188
189 1;