Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,900 changes: 987 additions & 913 deletions api/client/proto/authservice.pb.go

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions api/proto/teleport/legacy/client/proto/authservice.proto
Original file line number Diff line number Diff line change
Expand Up @@ -198,17 +198,22 @@ message HostCertsRequest {
// OpenSSHCertRequest specifies certificate-generation parameters
// for a certificates used to connect to Agentless nodes.
message OpenSSHCertRequest {
// Username is the Teleport username.
string Username = 1 [(gogoproto.jsontag) = "username"];
reserved 1; // Username, jsontag "username"
reserved "Username";
// PublicKey is the public key to sign.
bytes PublicKey = 2 [(gogoproto.jsontag) = "public_key"];
// TTL is the duration the certificate will be valid for.
int64 TTL = 3 [
(gogoproto.jsontag) = "ttl",
(gogoproto.casttype) = "Duration"
];
// Cluster is the Teleport cluster name.
// Cluster is the Teleport cluster name the target node is connected to.
string Cluster = 4 [(gogoproto.jsontag) = "cluster"];
// User is the Teleport user the certificate will be generated for.
types.UserV2 User = 5 [(gogoproto.jsontag) = "user"];
Comment thread
espadolini marked this conversation as resolved.
Outdated
// Roles are the roles of the Teleport user the certificate will be
// generated for.
repeated types.RoleV6 Roles = 6 [(gogoproto.jsontag) = "roles"];
}
Comment thread
capnspacehook marked this conversation as resolved.
Outdated

// OpenSSHCert is a SSH certificate signed by OpenSSH CA.
Expand Down
12 changes: 12 additions & 0 deletions api/types/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import (
"time"

"github.com/gravitational/trace"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/protoadapt"

"github.com/gravitational/teleport/api/constants"
"github.com/gravitational/teleport/api/utils"
Expand Down Expand Up @@ -450,6 +452,16 @@ func (u *UserV2) ResetLocks() {
u.Spec.Status.RecoveryAttemptLockExpires = time.Time{}
}

// DeepCopy creates a clone of this user value.
func (u *UserV2) DeepCopy() User {
// github.com/golang/protobuf/proto.Clone panics when trying to
// copy a map[K]V where the type of V is a slice of anything
// other than byte. See https://github.com/gogo/protobuf/issues/14
uV2 := protoadapt.MessageV2Of(u)
uV2Copy := proto.Clone(uV2)
return protoadapt.MessageV1Of(uV2Copy).(*UserV2)
}

// IsEmpty returns true if there's no info about who created this user
func (c CreatedBy) IsEmpty() bool {
return c.User.Name == ""
Expand Down
Loading