-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
API client Profile credential loader #5993
Conversation
cc5f20c
to
edc8a4b
Compare
@awly @andrejtokarcik Can you review? |
edc8a4b
to
6212a10
Compare
sshCertPath := filepath.Join(userKeyDir, p.Username+constants.FileExtSSHCert) | ||
err = ioutil.WriteFile(sshCertPath, []byte(sshCert), 0600) | ||
require.NoError(t, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI this will need to be updated after #5938
const ( | ||
// SessionKeyDir is the sub-directory where session keys are stored (.tsh/keys). | ||
SessionKeyDir = "keys" | ||
// FileNameKnownHosts is a file that stores known hosts. | ||
FileNameKnownHosts = "known_hosts" | ||
// FileExtTLSCert is the filename extension/suffix of TLS certs | ||
// stored in a profile (./tsh/keys/profilename/username-x509.pem). | ||
FileExtTLSCert = "-x509.pem" | ||
// FileNameTLSCerts is the filename of Cert Authorities stored in a | ||
// profile (./tsh/keys/profilename/certs.pem). | ||
FileNameTLSCerts = "certs.pem" | ||
// FileExtCert is a file extension used for SSH Certificate files. | ||
FileExtSSHCert = "-cert.pub" | ||
// FileExtPub is a file extension used for SSH Certificate Authorities | ||
// stored in a profile (./tsh/keys/profilename/username.pub). | ||
FileExtPub = ".pub" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These constants aren't really used in the api
module except for tests. Is the idea to gradually move everything from under lib/client
to api/client
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are also used in profile.go
in profile.TLSConfig()
and profile.SSHClientConfig()
. We only want to move things that are essential to the API, but the majority of lib/client
seems to be internal logic. I don't expect much more to be moved into api/client
.
4341deb
to
a0376ee
Compare
a0376ee
to
1d773b3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bot.
1d773b3
to
35d4766
Compare
35d4766
to
40d31f2
Compare
Changes:
api/client/profile.go
.Merge after #5625, which this is based upon.