]> source.dussan.org Git - gitea.git/commit
WebAuthn CredentialID field needs to be increased in size (#20530)
authorzeripath <art27@cantab.net>
Sat, 30 Jul 2022 13:25:26 +0000 (14:25 +0100)
committerGitHub <noreply@github.com>
Sat, 30 Jul 2022 13:25:26 +0000 (15:25 +0200)
commite819da083734ddbf30afbc62afd48e9d0e8f3d48
tree3d33258ef9c94fbe04502d51d2795056bbd1b87c
parent692707f14519b677de4601e5f40469989f82eed6
WebAuthn CredentialID field needs to be increased in size (#20530)

WebAuthn have updated their specification to set the maximum size of the
CredentialID to 1023 bytes. This is somewhat larger than our current
size and therefore we need to migrate.

The PR changes the struct to add CredentialIDBytes and migrates the CredentialID string
to the bytes field before another migration drops the old CredentialID field. Another migration
renames this field back.

Fix #20457

Signed-off-by: Andrew Thornton <art27@cantab.net>
models/auth/webauthn.go
models/auth/webauthn_test.go
models/migrations/fixtures/Test_storeWebauthnCredentialIDAsBytes/expected_webauthn_credential.yml [new file with mode: 0644]
models/migrations/fixtures/Test_storeWebauthnCredentialIDAsBytes/webauthn_credential.yml [new file with mode: 0644]
models/migrations/migrations.go
models/migrations/v221.go [new file with mode: 0644]
models/migrations/v221_test.go [new file with mode: 0644]
models/migrations/v222.go [new file with mode: 0644]
models/migrations/v223.go [new file with mode: 0644]
routers/web/auth/webauthn.go