kit-sdq / artemis4j

REST Client for the Artemis Project
Eclipse Public License 2.0
5 stars 6 forks source link

Artemis Token API & Authorization to GIT via SSH #81

Closed dfuchss closed 1 month ago

dfuchss commented 3 months ago

Tracking https://github.com/ls1intum/Artemis/pull/8929 and https://github.com/ls1intum/Artemis/pull/9182

dfuchss commented 2 months ago

@Feuermagier @Luro02 @CDaut would it be easy to check https://artemis.praktomat.cs.kit.edu/user-settings/sshSettings for a key. If the SSH key is set, you could easily clone via SSH until there is a feature for TAs . The linked feature is more for students not for Instructors and TAs.

Feuermagier commented 2 months ago

Yes, it's very easy, since the use entity contains a sshPublicKey field if the public key is set. However, the JGit side for cloning via SSH seems to be a bit involved, but I'm working on it.

dfuchss commented 2 months ago

If you clone directly via ssh URL it might grab the default ssh keys ; I think that might be enough :) But let's see :) thx for working on it :)

Feuermagier commented 2 months ago

I don't use the default key for Artemis on my system, so support for other keys is needed :P.

Turns out, the really weird thing is that Artemis does not give you the SSH URL directly, but only the base SSH URL and then uses a weird regex to transform the HTTPS URL to SSH (https://github.com/ls1intum/Artemis/blob/eb5b9bd4321d953217e902868ac9f38de6dd6c6f/src/main/webapp/app/shared/components/code-button/code-button.component.ts#L174). I've implemented (i.e. copied) it successfully, but it will certainly break at some point when Artemis changes something

dfuchss commented 2 months ago

Uff .. at least a comment to track might be very useful

dfuchss commented 2 months ago

The Token impls are linked in the description. For the grading tool, https://github.com/ls1intum/Artemis/pull/9182 might be most interesting. We can also generate the token if it does not exist :)

dfuchss commented 1 month ago

@Feuermagier @Luro02 @CDaut the Token-PR is merged and the current version is deployed to the test system, so this Issue can get high priority :)