-
-
Notifications
You must be signed in to change notification settings - Fork 902
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow using webauthn in places that currently require a password
i.e. allow using passkeys as a single auth factor
- Loading branch information
Showing
39 changed files
with
515 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class WebauthnCredentialResource < Avo::BaseResource | ||
self.title = :id | ||
self.includes = [] | ||
|
||
field :id, as: :id | ||
# Fields generated from the model | ||
field :external_id, as: :text | ||
field :public_key, as: :text | ||
field :nickname, as: :text | ||
field :sign_count, as: :number | ||
field :user, as: :belongs_to | ||
# add fields here | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class WebauthnVerificationResource < Avo::BaseResource | ||
self.title = :id | ||
self.includes = [] | ||
|
||
field :id, as: :id | ||
# Fields generated from the model | ||
field :path_token, as: :text | ||
field :path_token_expires_at, as: :date_time | ||
field :otp, as: :text | ||
field :otp_expires_at, as: :date_time | ||
field :user, as: :belongs_to | ||
# add fields here | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# This controller has been generated to enable Rails' resource routes. | ||
# More information on https://docs.avohq.io/2.0/controllers.html | ||
class Avo::WebauthnCredentialsController < Avo::ResourcesController | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# This controller has been generated to enable Rails' resource routes. | ||
# More information on https://docs.avohq.io/2.0/controllers.html | ||
class Avo::WebauthnVerificationsController < Avo::ResourcesController | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class WebauthnCredentialPolicy < ApplicationPolicy | ||
class Scope < Scope | ||
def resolve | ||
scope.all | ||
end | ||
end | ||
|
||
def avo_show? | ||
Pundit.policy!(user, record.user).avo_show? | ||
end | ||
|
||
has_association :user | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class WebauthnVerificationPolicy < ApplicationPolicy | ||
class Scope < Scope | ||
def resolve | ||
scope.all | ||
end | ||
end | ||
|
||
def avo_show? | ||
Pundit.policy!(user, record.user).avo_show? | ||
end | ||
|
||
has_association :user | ||
end |
Oops, something went wrong.