add PKCE support to device code flow (#2575)

Signed-off-by: Bob Callaway <bobcallaway@users.noreply.github.com>
This commit is contained in:
Bob Callaway
2022-07-27 09:02:18 -07:00
committed by GitHub
parent 454122ca22
commit 83e2df821e
20 changed files with 790 additions and 32 deletions

View File

@@ -8,12 +8,14 @@ import (
/* Original SQL table:
create table device_token
(
device_code text not null primary key,
status text not null,
token blob,
expiry timestamp not null,
last_request timestamp not null,
poll_interval integer not null
device_code text not null primary key,
status text not null,
token blob,
expiry timestamp not null,
last_request timestamp not null,
poll_interval integer not null,
code_challenge text default '' not null,
code_challenge_method text default '' not null
);
*/
@@ -38,6 +40,12 @@ func (DeviceToken) Fields() []ent.Field {
field.Time("last_request").
SchemaType(timeSchema),
field.Int("poll_interval"),
field.Text("code_challenge").
SchemaType(textSchema).
Default(""),
field.Text("code_challenge_method").
SchemaType(textSchema).
Default(""),
}
}