Skip to content

Provide generic interfaces for token based authorization#156

Merged
raakella1 merged 4 commits into
eBay:masterfrom
raakella1:remove_trf
Aug 7, 2023
Merged

Provide generic interfaces for token based authorization#156
raakella1 merged 4 commits into
eBay:masterfrom
raakella1:remove_trf

Conversation

@raakella1

@raakella1 raakella1 commented Aug 4, 2023

Copy link
Copy Markdown
Contributor

Replace the specific implementation of token based authorization with generic interfaces.

@raakella1
raakella1 requested review from hkadayam and szmyd August 4, 2023 01:21
@raakella1 raakella1 changed the title Remove trf Provide generic interfaces for token based authorization Aug 4, 2023
@codecov-commenter

codecov-commenter commented Aug 4, 2023

Copy link
Copy Markdown

Codecov Report

Merging #156 (7823e24) into master (04aad0e) will decrease coverage by 0.72%.
The diff coverage is 80.00%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##           master     #156      +/-   ##
==========================================
- Coverage   63.84%   63.12%   -0.72%     
==========================================
  Files          71       68       -3     
  Lines        4306     4160     -146     
  Branches      530      521       -9     
==========================================
- Hits         2749     2626     -123     
+ Misses       1329     1308      -21     
+ Partials      228      226       -2     
Components Coverage Δ
AuthManager 100.00% <100.00%> (+5.59%) ⬆️
Cache 28.06% <ø> (-0.38%) ⬇️
FDS 68.42% <ø> (+0.09%) ⬆️
FileWatcher 55.90% <ø> (ø)
Flip 65.67% <ø> (ø)
gRPC 77.97% <73.91%> (+0.86%) ⬆️
Logging 29.41% <ø> (ø)
Metrics 80.20% <ø> (ø)
Options 100.00% <ø> (ø)
Setting 57.98% <ø> (+1.30%) ⬆️
StatusObject 73.83% <ø> (ø)
Utility 84.19% <ø> (+0.69%) ⬆️
Version 95.83% <ø> (ø)

class GrpcTokenClient : public TokenClient {
public:
explicit GrpcTokenClient(std::string const& auth_header_key) : m_auth_header_key(auth_header_key) {}
virtual ~GrpcTokenClient() = default;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

override?

public:
virtual ~TokenClient() = default;

virtual std::string get_token() = 0;

@szmyd szmyd Aug 7, 2023

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const
Is this only ever implemented/used by the Mock? I don't see it defined anywhere. Not clear what this interface is for since even GrpcTokenClient doesn't fully implement it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only ever implemented by Mock for unit tests. The real implementation will be in the new library I created, which is ebay specific.
https://github.corp.ebay.com/SDS/auth_manager/tree/inherit_from_sisl/src/include/auth_manager
The idea is if the user wants a token based auth system, they implement these interfaces and pass it along to grpc client and server. Any implementation would be ebay specific and cannot live here in sisl

@szmyd szmyd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not clear to me why there are two interfaces here?

@szmyd szmyd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@raakella1
raakella1 merged commit 0426e3d into eBay:master Aug 7, 2023
@raakella1
raakella1 deleted the remove_trf branch August 7, 2023 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants