-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add autocorrect force all offences
- Loading branch information
Showing
32 changed files
with
441 additions
and
364 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
require "active_support/concern" | ||
|
||
module Clerk | ||
|
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 |
---|---|---|
@@ -1,49 +1,51 @@ | ||
# frozen_string_literal: true | ||
|
||
module Clerk | ||
SESSION_COOKIE = "__session".freeze | ||
CLIENT_UAT_COOKIE = "__client_uat".freeze | ||
SESSION_COOKIE = "__session" | ||
CLIENT_UAT_COOKIE = "__client_uat" | ||
|
||
# Dev Browser | ||
DEV_BROWSER_COOKIE = "__clerk_db_jwt".freeze | ||
DEV_BROWSER_COOKIE = "__clerk_db_jwt" | ||
|
||
# Handshake | ||
HANDSHAKE_COOKIE = "__clerk_handshake".freeze | ||
HANDSHAKE_HELP_QUERY_PARAM = "__clerk_help".freeze | ||
HANDSHAKE_COOKIE_DIRECTIVES_KEY = "handshake".freeze | ||
HANDSHAKE_COOKIE = "__clerk_handshake" | ||
HANDSHAKE_HELP_QUERY_PARAM = "__clerk_help" | ||
HANDSHAKE_COOKIE_DIRECTIVES_KEY = "handshake" | ||
|
||
# auth debug response headers | ||
AUTH_STATUS_HEADER = "X-Clerk-Auth-Status".freeze | ||
AUTH_REASON_HEADER = "X-Clerk-Auth-Reason".freeze | ||
AUTH_MESSAGE_HEADER = "X-Clerk-Auth-Message".freeze | ||
AUTH_STATUS_HEADER = "X-Clerk-Auth-Status" | ||
AUTH_REASON_HEADER = "X-Clerk-Auth-Reason" | ||
AUTH_MESSAGE_HEADER = "X-Clerk-Auth-Message" | ||
|
||
CONTENT_TYPE_HEADER = "Content-Type".freeze | ||
SEC_FETCH_DEST_HEADER = "HTTP_SEC_FETCH_DEST".freeze | ||
CONTENT_TYPE_HEADER = "Content-Type" | ||
SEC_FETCH_DEST_HEADER = "HTTP_SEC_FETCH_DEST" | ||
|
||
# headers used in response - should be lowered case and without http prefix | ||
LOCATION_HEADER = "Location".freeze | ||
COOKIE_HEADER = "Set-Cookie".freeze | ||
LOCATION_HEADER = "Location" | ||
COOKIE_HEADER = "Set-Cookie" | ||
|
||
# clerk url related headers | ||
AUTHORIZATION_HEADER = "HTTP_AUTHORIZATION".freeze | ||
ACCEPT_HEADER = "HTTP_ACCEPT".freeze | ||
USER_AGENT_HEADER = "HTTP_USER_AGENT".freeze | ||
ORIGIN_HEADER = "HTTP_ORIGIN".freeze | ||
AUTHORIZATION_HEADER = "HTTP_AUTHORIZATION" | ||
ACCEPT_HEADER = "HTTP_ACCEPT" | ||
USER_AGENT_HEADER = "HTTP_USER_AGENT" | ||
ORIGIN_HEADER = "HTTP_ORIGIN" | ||
|
||
module TokenVerificationErrorReason | ||
TOKEN_INVALID = "token-invalid".freeze | ||
TOKEN_EXPIRED = "token-expired".freeze | ||
TOKEN_NOT_ACTIVE_YET = "token-not-active-yet".freeze | ||
JWK_FAILED_TO_RESOLVE = "jwk-failed-to-resolve".freeze | ||
TOKEN_INVALID = "token-invalid" | ||
TOKEN_EXPIRED = "token-expired" | ||
TOKEN_NOT_ACTIVE_YET = "token-not-active-yet" | ||
JWK_FAILED_TO_RESOLVE = "jwk-failed-to-resolve" | ||
end | ||
|
||
module AuthErrorReason | ||
CLIENT_UAT_WITHOUT_SESSION_TOKEN = "client-uat-but-no-session-token".freeze | ||
DEV_BROWSER_SYNC = "dev-browser-sync".freeze | ||
PRIMARY_RESPONDS_TO_SYNCING = "primary-responds-to-syncing".freeze | ||
SATELLITE_COOKIE_NEEDS_SYNCING = "satellite-needs-syncing".freeze | ||
SESSION_TOKEN_AND_UAT_MISSING = "session-token-and-uat-missing".freeze | ||
SESSION_TOKEN_MISSING = "session-token-missing".freeze | ||
SESSION_TOKEN_OUTDATED = "session-token-outdated".freeze | ||
SESSION_TOKEN_WITHOUT_CLIENT_UAT = "session-token-but-no-client-uat".freeze | ||
UNEXPECTED_ERROR = "unexpected-error".freeze | ||
CLIENT_UAT_WITHOUT_SESSION_TOKEN = "client-uat-but-no-session-token" | ||
DEV_BROWSER_SYNC = "dev-browser-sync" | ||
PRIMARY_RESPONDS_TO_SYNCING = "primary-responds-to-syncing" | ||
SATELLITE_COOKIE_NEEDS_SYNCING = "satellite-needs-syncing" | ||
SESSION_TOKEN_AND_UAT_MISSING = "session-token-and-uat-missing" | ||
SESSION_TOKEN_MISSING = "session-token-missing" | ||
SESSION_TOKEN_OUTDATED = "session-token-outdated" | ||
SESSION_TOKEN_WITHOUT_CLIENT_UAT = "session-token-but-no-client-uat" | ||
UNEXPECTED_ERROR = "unexpected-error" | ||
end | ||
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Clerk | ||
module Errors | ||
class Base < StandardError | ||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
class JWKSCache | ||
def initialize(lifetime) | ||
@lifetime = lifetime | ||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
require "forwardable" | ||
require_relative "singular_resource" | ||
|
||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
require "forwardable" | ||
require_relative "plural_resource" | ||
|
||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
require "forwardable" | ||
require_relative "plural_resource" | ||
|
||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
require "forwardable" | ||
require_relative "plural_resource" | ||
|
||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
require "forwardable" | ||
require_relative "plural_resource" | ||
|
||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
require "forwardable" | ||
require_relative "plural_resource" | ||
|
||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
require "forwardable" | ||
require_relative "plural_resource" | ||
|
||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
require "forwardable" | ||
require_relative "plural_resource" | ||
|
||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Clerk | ||
module Resources | ||
class PluralResource | ||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
require "forwardable" | ||
require_relative "plural_resource" | ||
|
||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Clerk | ||
module Resources | ||
class SingularResource | ||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
require "forwardable" | ||
require_relative "plural_resource" | ||
|
||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Clerk | ||
module Utils | ||
module_function | ||
|
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
Oops, something went wrong.