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

refactor(jans-cedarling): make JwtService process tokens one at a time #10409

Closed
3 of 9 tasks
rmarinn opened this issue Dec 12, 2024 · 1 comment
Closed
3 of 9 tasks
Assignees
Labels
comp-jans-cedarling Touching folder /jans-cedarling kind-enhancement Issue or PR is an enhancement to an existing functionality
Milestone

Comments

@rmarinn
Copy link
Contributor

rmarinn commented Dec 12, 2024


Description

  • Development target issue

Target issue: refactor(jans-cedarling): make tokens optional #10408

  • Implementation Details

since we need to make tokens optional for #10408, the current interface for the token validation should be updated so that all tokens would be optional:

Current implementation:

    pub fn process_tokens<'a, A, I, U>(
        &'a self,
        access_token: &'a str,
        id_token: &'a str,
        userinfo_token: Option<&'a str>,
    ) -> Result<ProcessTokensResult<'a, A, I, U>, JwtProcessingError>
    where
        A: Option<>,
        I: DeserializeOwned,
        U: DeserializeOwned,
    {
        // ...
    }

Proposed implementation:
Something like this would probably easier to use for the authz module. ProcessTokensResult should probably return an Option<TrustedIssuer> to find the trusted issuer need for the mapping.

enum UnprocessedJwt {
    Access(String),
    Id(String),
    Userinfo(String),
}

struct ProcessedJwt;

pub fn process_token(
    &'a self,
    token: UnprocessedJwt ,
) -> Result<ProcessedJwt, JwtProcessingError>
{
    // ....
}

Prepare

  • Read contribution guidelines
  • Read license information

Identified code changes

  • implement a single function for authz to call for validating a token.

Test cases and code coverage

  • Write unit test to cover added/changed code
  • Update integration tests to cover added/changed code NA

Document the changes

  • task for updating user guides if needed NA
  • task for updating installation and configuration guides if needed NA
  • task for updating developer documentation if needed NA
  • task for updating technical documentation if needed NA
@rmarinn rmarinn self-assigned this Dec 12, 2024
@rmarinn rmarinn added the comp-jans-cedarling Touching folder /jans-cedarling label Dec 12, 2024
@mo-auto mo-auto added the kind-enhancement Issue or PR is an enhancement to an existing functionality label Dec 12, 2024
@rmarinn rmarinn changed the title refactor(jans-cedarling): refactor(jans-cedarling): make process_tokens params optional Dec 12, 2024
@rmarinn rmarinn changed the title refactor(jans-cedarling): make process_tokens params optional refactor(jans-cedarling): make JwtService process tokens one at a time Dec 12, 2024
@moabu moabu added this to the next-release milestone Dec 16, 2024
@rmarinn
Copy link
Contributor Author

rmarinn commented Dec 17, 2024

will be implemented with #10408.

@rmarinn rmarinn closed this as completed Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-jans-cedarling Touching folder /jans-cedarling kind-enhancement Issue or PR is an enhancement to an existing functionality
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

3 participants