question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Generic] Allow passing period-separated string for nested `claim_groups_key` in generic_client

See original GitHub issue

Proposed change

Allow passing for example claim_groups_key=permissions.groups to GenericOAuthenticator, to extract the groups from a claim with the form

{
    "permissions": {
        "groups" : ["mygroup1", "mygroup2"]
    }
}

Alternative options

It is currently possible to do this by passing a Callable() that returns the groups given the user object, but I find this not configurable enough. It is also very finnicky (probably impossible) to use with the kubernetes-hosted jupyter hub.

Who would use this feature?

For example, KeyCloak exposes its group claim under realm_access.roles. Therefore, I cannot currently implement authorization on our kubernetes-hosted jupyterhub instance.

(Optional): Suggest a solution

Similar classes in for example Java spring boot use a period to separate nested keys. I think we should do the same.

This will be a breaking change for users who have a key with a period in it. I think this is an edge case but do you think we should design for it?

I implemented a quick fix for this in this pr: https://github.com/jupyterhub/oauthenticator/pull/537

Any feedback is appreciated on this.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
consideRatiocommented, Sep 8, 2022

I think only a minor version bump is relevant for this, I’ll look into making one directly because why not.

1reaction
consideRatiocommented, Sep 8, 2022

Done!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pass type to generic method (nested generic) - Stack Overflow
You cannot code Generic methods to run by passing a runtime Type. Generics need to have the type at compile time.
Read more >
Generics - .NET MAUI | Microsoft Learn
NET MAUI XAML provides support for consuming generic CLR types by specifying the generic constraints as type arguments.
Read more >
How To Use Generics in TypeScript - DigitalOcean
Generics are a fundamental feature of statically-typed languages, allowing developers to pass types as parameters to a type, function, ...
Read more >
C# Generics - TutorialsTeacher
In C#, generic means not specific to a particular data type. C# allows you to define generic classes, interfaces, abstract classes, fields, methods,...
Read more >
Generic Methods - Java™ Tutorials
Object[] oa = new Object[100]; Collection<Object> co = new ArrayList<Object>(); // T inferred to be Object fromArrayToCollection(oa, co); String[] sa = new ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found