Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: move operations to nested Auth and User structs #30

Merged
merged 10 commits into from
Dec 19, 2024

Conversation

ctran88
Copy link
Contributor

@ctran88 ctran88 commented Dec 17, 2024

What's New?

  • moves auth operations under a nested Auth struct
  • moves user operations under a nested User struct
  • keeps the set_server_url func to maintain tests until they are moved to the e2e suite
  • removes the get_app func since it doesn't really serve much purpose except for a test of the sdk without inducing any side effects

Screenshots (if appropriate):

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have manually tested my code thoroughly
  • I have added/updated inline documentation for public facing interfaces if relevant
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing integration and unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Additional context

@ctran88 ctran88 marked this pull request as ready for review December 17, 2024 01:57
@@ -62,5 +62,7 @@ pub mod models;
#[rustfmt::skip]
pub mod openapi;

pub mod auth;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

i think this would also expose the auth and user structs to the developer

Comment on lines +59 to +60
self.user.configuration.base_path = format!("{}/v1/apps/{}", server_url, self.app_id);
self.auth.configuration.base_path = format!("{}/v1/apps/{}", server_url, self.app_id);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

necessary to mock the server calls in the unit tests. this can be removed once the tests are moved to the e2e suite

@bertrmz
Copy link
Contributor

bertrmz commented Dec 18, 2024

The repo's README will also need updates to reference the nested structure.

@ctran88 ctran88 force-pushed the PSG-5150-add-new-nested-classes branch from 7661fde to a1540af Compare December 18, 2024 15:58
@ctran88
Copy link
Contributor Author

ctran88 commented Dec 18, 2024

The repo's README will also need updates to reference the nested structure.

updated in a1540af

README.md Outdated Show resolved Hide resolved
@bertrmz
Copy link
Contributor

bertrmz commented Dec 18, 2024

There's a usage example in lib.rs that will need to be updated:

//! let app_info = passage_flex.get_app().await.unwrap();

EDIT: Looks like this also applies to the various methods that were moved around, like this example:

/// let user_info = passage_flex.get(external_id.to_string()).await.unwrap();

@ctran88
Copy link
Contributor Author

ctran88 commented Dec 18, 2024

There's a usage example in lib.rs that will need to be updated:

80ef1f4

also removed the GetAppError in f22a04e

@ctran88 ctran88 changed the title feat: move operations to nested Auth and User structs feat!: move operations to nested Auth and User structs Dec 18, 2024
@ctran88 ctran88 requested a review from bertrmz December 18, 2024 19:13
src/auth.rs Show resolved Hide resolved
src/error.rs Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
@ctran88 ctran88 requested a review from bertrmz December 19, 2024 16:11
src/auth.rs Outdated Show resolved Hide resolved
src/user.rs Show resolved Hide resolved
@ctran88 ctran88 force-pushed the PSG-5150-add-new-nested-classes branch from ac297a2 to 943b1e9 Compare December 19, 2024 18:21
@ctran88 ctran88 merged commit ab086d2 into main Dec 19, 2024
5 checks passed
@ctran88 ctran88 deleted the PSG-5150-add-new-nested-classes branch December 19, 2024 18:38
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.

2 participants