-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add authentication helpers for Ruby and Go (#119)
- Loading branch information
1 parent
1dbb888
commit d41a1a8
Showing
7 changed files
with
81 additions
and
27 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
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,39 @@ | ||
# frozen_string_literal: true | ||
|
||
module Flipt | ||
class AuthenticationStrategy | ||
def strategy | ||
raise NotImplementedError | ||
end | ||
end | ||
|
||
class NoAuthentication < AuthenticationStrategy | ||
def strategy | ||
nil | ||
end | ||
end | ||
|
||
class ClientTokenAuthentication < AuthenticationStrategy | ||
def initialize(token) | ||
@token = token | ||
end | ||
|
||
def strategy | ||
{ | ||
client_token: @token | ||
} | ||
end | ||
end | ||
|
||
class JWTAuthentication < AuthenticationStrategy | ||
def initialize(token) | ||
@token = token | ||
end | ||
|
||
def strategy | ||
{ | ||
jwt_token: @token | ||
} | ||
end | ||
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
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