Authentication Implementation for Ruby #1757
Authentication Implementation for Ruby #1757osose-e merged 17 commits intoosose-authentication-featuresfrom
Conversation
|
Kudos, SonarCloud Quality Gate passed! |
| @@ -0,0 +1,9 @@ | |||
| example_id | status | run_time | | |||
There was a problem hiding this comment.
we should remove this file and add a the extension to .gitignore
| class AllowedHostsValidator | ||
| # creates a new AllocatedHostsValidator with provided values | ||
| def initialize(allowed_hosts) | ||
| @allowed_hosts = [] |
There was a problem hiding this comment.
why was the implementation removed? this needs to be reverted
| # allowed_hosts: an array of strings, where each string is an allowed host, default is empty | ||
| # scopes: an array of strings, where each string is a scope, default is empty array | ||
| # auth_code: a string containting the auth code; default is nil, can be updated post-initialization | ||
| def initialize(token_request_context, allowed_hosts = [], scopes = []) |
There was a problem hiding this comment.
I believe the first parameter needs to be removed and the implementation will call this base constructor
I also believe it should instantiate the host validator instead of throwing a not implemented exception
| include Concurrent::Async | ||
|
|
||
| AUTHORIZATION_HEADER_KEY = 'Authorization' | ||
| def authenticate_request(request) |
There was a problem hiding this comment.
why was the implementation removed? it should provide a default implementation using the access token provider to avoid duplication
| @@ -0,0 +1,43 @@ | |||
| # frozen_string_literal: true | |||
|
|
|||
| require 'oauth2' | |||
There was a problem hiding this comment.
this needs to be moved into its own library
|
|
||
| module MicrosoftKiotaAuthentication | ||
| # Access Token Provider class implementation | ||
| class AccessTokenProvider |
There was a problem hiding this comment.
split into 2: the generic code needs to move to the access token provider in abstractions
the code that's specific to oauth2/microsoft identity platform stays here
and rename to azure access token provider
|
|
||
| require 'uri' | ||
|
|
||
| module MicrosoftKiotaAuthentication |
There was a problem hiding this comment.
needs to move back to abstractions
| @@ -0,0 +1,10 @@ | |||
| require 'concurrent' | |||
|
|
|||
| module MicrosoftKiotaAuthentication | |||
| @@ -0,0 +1,9 @@ | |||
| module MicrosoftKiotaAuthentication | |||
| module AuthenticationProvider | |||
| require_relative './authentication_provider' | ||
| require_relative './access_token_provider' | ||
|
|
||
| module MicrosoftKiotaAuthentication |








fixes #421
fixes #1638
fixes #1643