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: Add minimal client implementation for auth services #76

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Giriharan219
Copy link
Collaborator

What does this Pull Request accomplish?

This PR adds some client methods for auth endpoints and testing for these endpoints.

Why should this Pull Request be merged?

This Minimal client for auth APIs will enable users to more easily interact with that APIs.

What testing has been done?

Auto testing is included against NI's test tier.

API Link: Swagger-link

@Giriharan219 Giriharan219 added the enhancement New feature or request label Oct 30, 2024
@Giriharan219 Giriharan219 changed the title Feat: Add minimal client implementation for auth services feat: Add minimal client implementation for auth services Oct 30, 2024
nisystemlink/clients/auth/utilities.py Outdated Show resolved Hide resolved
nisystemlink/clients/auth/utilities.py Outdated Show resolved Hide resolved
from . import models


class AuthClient(BaseClient):
Copy link
Member

Choose a reason for hiding this comment

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

Naming this AccessControlClient makes it intuitive and clubs the related feature across multiple services under the same client.
@mure, @spanglerco, @cameronwaterman - please share your thoughts

Choose a reason for hiding this comment

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

@santhoshramaraj I think that it's worth leaving this as-is (auth), then creating a secondary API specifically to expose access control functionality (creating/changing roles and/or workspace permissions management), as they are closely related, but really two different concepts.

As I mentioned in my comments, I think the auth functionality is pretty fundamental and might be worth somehow incorporating into the base class itself, but access control definitely doesn't belong there.

nisystemlink/clients/auth/_auth_client.py Outdated Show resolved Hide resolved
nisystemlink/clients/auth/_auth_client.py Outdated Show resolved Hide resolved
nisystemlink/clients/auth/utilities.py Outdated Show resolved Hide resolved
nisystemlink/clients/auth/models/_auth_models.py Outdated Show resolved Hide resolved
nisystemlink/clients/auth/models/_auth_models.py Outdated Show resolved Hide resolved
nisystemlink/clients/auth/models/_auth_models.py Outdated Show resolved Hide resolved
nisystemlink/clients/auth/models/_auth_models.py Outdated Show resolved Hide resolved
@Giriharan219 Giriharan219 force-pushed the users/gravichandran/add-auth-client branch from 627888a to 5d0f4bf Compare November 5, 2024 16:50
@Giriharan219 Giriharan219 force-pushed the users/gravichandran/add-auth-client branch from 5d0f4bf to ad7e3f0 Compare November 5, 2024 16:58
@Giriharan219 Giriharan219 force-pushed the users/gravichandran/add-auth-client branch from 5e854a2 to b6b1c51 Compare November 7, 2024 07:03
@Giriharan219 Giriharan219 force-pushed the users/gravichandran/add-auth-client branch from b6b1c51 to bfd9308 Compare November 7, 2024 13:09
@ChrisStrykesAgain
Copy link

Most of this functionality seems pretty core to the fundamental operations. Would it make more sense to bake this into a base class shared across the various APIs instead of having an explicit API just for this?

@ChrisStrykesAgain
Copy link

@santhoshramaraj @spanglerco @cameronwaterman I need this functionality for a project I'm working on. If you're OK with the functionality being built into the base class (my preference per my last comment), I'll implement it here pretty quickly. If not, can we get this PR approved and/or any last comments/changes requested? Thanks!

@ChrisStrykesAgain
Copy link

Actually, thinking through this a little:

The thing I need, and what I think should really be in the base class is a "get workspace by name" method. The cleanest approach here would probably be to keep auth as it's own class (so basically what's in this PR) and add a class member variable of this type to the base class. I'd prefer to create a wrapper over the "get workspace" function to promote it to a first-class member, but then you'd still have the auth methods available to you as calls on the class member itself.

Does that seem reasonable?

Args:
configuration: Defines the web server to connect to and information about
how to connect. If not provided, an instance of
:class:`JupyterHttpConfiguration <nisystemlink.clients.core.JupyterHttpConfiguration>` # noqa: W505
Copy link

@ChrisStrykesAgain ChrisStrykesAgain Jan 27, 2025

Choose a reason for hiding this comment

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

I think this would use an instance of HttpConfiguration and not JupyterHttpConfiguration, right? Or am I missing something? I guess it depends on context. Might be worth a clarifying note, though, as users very well may be running in something other than a JupyterHub environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants