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

add jwt to dial jump server #1532

Merged
merged 3 commits into from
Jan 31, 2025

Conversation

SimoneDutto
Copy link
Contributor

Description

In this PR we add the jwt when dial controller's ssh server.
The JWT is created together when resolving the controller's addresses.

I've added some tests for the ssh manager and ssh jump server.

Engineering checklist

  • Documentation updated
  • Covered by unit tests
  • Covered by integration tests

Test instructions

@SimoneDutto SimoneDutto requested a review from a team as a code owner January 24, 2025 15:05
internal/jimm/jimm.go Outdated Show resolved Hide resolved
internal/jimm/ssh/ssh_test.go Show resolved Hide resolved
internal/ssh/ssh_test.go Show resolved Hide resolved
internal/testutils/jimmtest/mocks/jwt_service_mock.go Outdated Show resolved Hide resolved
internal/ssh/ssh_test.go Outdated Show resolved Hide resolved
@SimoneDutto SimoneDutto requested a review from kian99 January 27, 2025 10:39
connInfo, err := s.sshManager.ConnInfoFromModelUUID(ctx, s.allowedModelUUID, s.userWithAccess)
c.Assert(err, qt.IsNil)
c.Assert(connInfo.Addrs, qt.HasLen, 1)
c.Assert(connInfo.JWT, qt.Not(qt.HasLen), 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a requirement, but we could also test that the JWT has the expected claims.

internal/jimm/ssh/ssh.go Outdated Show resolved Hide resolved
internal/jimm/ssh/ssh.go Outdated Show resolved Hide resolved
internal/jimm/ssh/ssh.go Outdated Show resolved Hide resolved
internal/jimm/ssh/ssh.go Outdated Show resolved Hide resolved
@SimoneDutto SimoneDutto force-pushed the JUJU-7351/add-jwt-auth branch 2 times, most recently from 5a52ecc to 8b7e4d6 Compare January 29, 2025 16:19
@SimoneDutto SimoneDutto force-pushed the JUJU-7351/add-jwt-auth branch from 8b7e4d6 to e596269 Compare January 31, 2025 14:14
@SimoneDutto SimoneDutto merged commit d2a97b2 into canonical:v3 Jan 31, 2025
4 checks passed
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