Skip to content

git: support ssh agent authentication - #2037

Closed
aluzzardi wants to merge 1 commit into
dagger:mainfrom
aluzzardi:git-clone-ssh-agent
Closed

aluzzardi wants to merge 1 commit into
dagger:mainfrom
aluzzardi:git-clone-ssh-agent

Conversation

@aluzzardi

@aluzzardi aluzzardi commented Apr 4, 2022 •

Copy link
Copy Markdown
Contributor

It's functional. However I had to hardcode the SSH_AUTH_SOCK path, which is not going to work.

Any idea @helderco?

@helderco

helderco commented Apr 4, 2022

Copy link
Copy Markdown
Contributor

I believe #2034 is not about the Git package, it's about dagger project update <private-git-repo>.

@helderco

helderco commented Apr 4, 2022

Copy link
Copy Markdown
Contributor

I think there's an issue somewhere from a user trying to get a client: filesystem path from a client: env variable and there was a limitation there. Let me see if I can find it.

@aluzzardi

Copy link
Copy Markdown
Contributor Author

I believe #2034 is not about the Git package, it's about dagger project update .

Oh, right. Well, it's a nice feature nonetheless :) But less important then.

I think there's an issue somewhere from a user trying to get a client: filesystem path from a client: env variable and there was a limitation there. Let me see if I can find it.

Yeah, that's what I found

@helderco

helderco commented Apr 4, 2022

Copy link
Copy Markdown
Contributor

Maybe it's because of this:

Does cue eval show you a disjunction like that?

@helderco

helderco commented Apr 4, 2022

Copy link
Copy Markdown
Contributor

@aluzzardi aluzzardi removed the go label Apr 13, 2022
@helderco helderco mentioned this pull request Apr 14, 2022
2 tasks done
@github-actions

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@helderco

helderco commented Apr 28, 2022 •

Copy link
Copy Markdown
Contributor

@helderco

Copy link
Copy Markdown
Contributor

Try this:

client: {
    env: SSH_AUTH_SOCK: string
    network: ssh: {
        address: env.SSH_AUTH_SOCK
        connect: dagger.#Socket
    }
}
actions: {
    ...
    auth: sshAgent: client.network.ssh.connect
    ...
}

@aluzzardi
aluzzardi force-pushed the git-clone-ssh-agent branch from 1fb3052 to 6196c3a Compare May 6, 2022 22:04
@aluzzardi

Copy link
Copy Markdown
Contributor Author

@helderco It works!

Not sure how to test this in CI though ...

@aluzzardi
aluzzardi marked this pull request as ready for review May 6, 2022 22:05
@aluzzardi
aluzzardi requested review from a team, helderco and shykes as code owners May 6, 2022 22:05
@aluzzardi
aluzzardi force-pushed the git-clone-ssh-agent branch from 6196c3a to 1fb2f60 Compare May 6, 2022 22:08
@github-actions

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions

Copy link
Copy Markdown
Contributor

This PR was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions Bot closed this May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants