Loading deploy_keys.go +4 −0 Original line number Diff line number Diff line Loading @@ -125,7 +125,9 @@ type InstanceDeployKey struct { Title string `json:"title"` CreatedAt *time.Time `json:"created_at"` ExpiresAt *time.Time `json:"expires_at"` LastUsedAt *time.Time `json:"last_used_at"` Key string `json:"key"` UsageType string `json:"usage_type"` Fingerprint string `json:"fingerprint"` FingerprintSHA256 string `json:"fingerprint_sha256"` ProjectsWithWriteAccess []*DeployKeyProject `json:"projects_with_write_access"` Loading Loading @@ -156,11 +158,13 @@ type ProjectDeployKey struct { ID int64 `json:"id"` Title string `json:"title"` Key string `json:"key"` UsageType string `json:"usage_type"` Fingerprint string `json:"fingerprint"` FingerprintSHA256 string `json:"fingerprint_sha256"` CreatedAt *time.Time `json:"created_at"` CanPush bool `json:"can_push"` ExpiresAt *time.Time `json:"expires_at"` LastUsedAt *time.Time `json:"last_used_at"` } func (k ProjectDeployKey) String() string { Loading deploy_keys_test.go +9 −1 Original line number Diff line number Diff line Loading @@ -35,8 +35,10 @@ func TestListAllDeployKeys(t *testing.T) { "id": 1, "title": "Public key", "key": "ssh-rsa AAAA...", "usage_type": "auth", "fingerprint": "7f:72:08:7d:0e:47:48:ec:37:79:b2:76:68:b5:87:65", "created_at": "2013-10-02T10:12:29Z", "last_used_at": "2024-10-03T01:32:21.992Z", "projects_with_write_access": [ { "id": 73, Loading Loading @@ -78,7 +80,9 @@ func TestListAllDeployKeys(t *testing.T) { ID: 1, Title: "Public key", Key: "ssh-rsa AAAA...", UsageType: "auth", CreatedAt: mustParseTime("2013-10-02T10:12:29Z"), LastUsedAt: mustParseTime("2024-10-03T01:32:21.992Z"), Fingerprint: "7f:72:08:7d:0e:47:48:ec:37:79:b2:76:68:b5:87:65", ProjectsWithWriteAccess: []*DeployKeyProject{ { Loading Loading @@ -266,10 +270,12 @@ func TestGetDeployKey(t *testing.T) { "id": 1, "title": "Public key", "key": "ssh-rsa AAAA...", "usage_type": "auth_and_signing", "fingerprint": "4a:9d:64:15:ed:3a:e6:07:6e:89:36:b3:3b:03:05:d9", "fingerprint_sha256": "SHA256:Jrs3LD1Ji30xNLtTVf9NDCj7kkBgPBb2pjvTZ3HfIgU", "created_at": "2013-10-02T10:12:29Z", "can_push": false "can_push": false, "last_used_at": "2024-10-03T01:32:21.992Z" }`) }) Loading @@ -281,10 +287,12 @@ func TestGetDeployKey(t *testing.T) { ID: 1, Title: "Public key", Key: "ssh-rsa AAAA...", UsageType: "auth_and_signing", Fingerprint: "4a:9d:64:15:ed:3a:e6:07:6e:89:36:b3:3b:03:05:d9", FingerprintSHA256: "SHA256:Jrs3LD1Ji30xNLtTVf9NDCj7kkBgPBb2pjvTZ3HfIgU", CreatedAt: mustParseTime("2013-10-02T10:12:29Z"), CanPush: false, LastUsedAt: mustParseTime("2024-10-03T01:32:21.992Z"), } assert.Equal(t, want, deployKey) } Loading Loading
deploy_keys.go +4 −0 Original line number Diff line number Diff line Loading @@ -125,7 +125,9 @@ type InstanceDeployKey struct { Title string `json:"title"` CreatedAt *time.Time `json:"created_at"` ExpiresAt *time.Time `json:"expires_at"` LastUsedAt *time.Time `json:"last_used_at"` Key string `json:"key"` UsageType string `json:"usage_type"` Fingerprint string `json:"fingerprint"` FingerprintSHA256 string `json:"fingerprint_sha256"` ProjectsWithWriteAccess []*DeployKeyProject `json:"projects_with_write_access"` Loading Loading @@ -156,11 +158,13 @@ type ProjectDeployKey struct { ID int64 `json:"id"` Title string `json:"title"` Key string `json:"key"` UsageType string `json:"usage_type"` Fingerprint string `json:"fingerprint"` FingerprintSHA256 string `json:"fingerprint_sha256"` CreatedAt *time.Time `json:"created_at"` CanPush bool `json:"can_push"` ExpiresAt *time.Time `json:"expires_at"` LastUsedAt *time.Time `json:"last_used_at"` } func (k ProjectDeployKey) String() string { Loading
deploy_keys_test.go +9 −1 Original line number Diff line number Diff line Loading @@ -35,8 +35,10 @@ func TestListAllDeployKeys(t *testing.T) { "id": 1, "title": "Public key", "key": "ssh-rsa AAAA...", "usage_type": "auth", "fingerprint": "7f:72:08:7d:0e:47:48:ec:37:79:b2:76:68:b5:87:65", "created_at": "2013-10-02T10:12:29Z", "last_used_at": "2024-10-03T01:32:21.992Z", "projects_with_write_access": [ { "id": 73, Loading Loading @@ -78,7 +80,9 @@ func TestListAllDeployKeys(t *testing.T) { ID: 1, Title: "Public key", Key: "ssh-rsa AAAA...", UsageType: "auth", CreatedAt: mustParseTime("2013-10-02T10:12:29Z"), LastUsedAt: mustParseTime("2024-10-03T01:32:21.992Z"), Fingerprint: "7f:72:08:7d:0e:47:48:ec:37:79:b2:76:68:b5:87:65", ProjectsWithWriteAccess: []*DeployKeyProject{ { Loading Loading @@ -266,10 +270,12 @@ func TestGetDeployKey(t *testing.T) { "id": 1, "title": "Public key", "key": "ssh-rsa AAAA...", "usage_type": "auth_and_signing", "fingerprint": "4a:9d:64:15:ed:3a:e6:07:6e:89:36:b3:3b:03:05:d9", "fingerprint_sha256": "SHA256:Jrs3LD1Ji30xNLtTVf9NDCj7kkBgPBb2pjvTZ3HfIgU", "created_at": "2013-10-02T10:12:29Z", "can_push": false "can_push": false, "last_used_at": "2024-10-03T01:32:21.992Z" }`) }) Loading @@ -281,10 +287,12 @@ func TestGetDeployKey(t *testing.T) { ID: 1, Title: "Public key", Key: "ssh-rsa AAAA...", UsageType: "auth_and_signing", Fingerprint: "4a:9d:64:15:ed:3a:e6:07:6e:89:36:b3:3b:03:05:d9", FingerprintSHA256: "SHA256:Jrs3LD1Ji30xNLtTVf9NDCj7kkBgPBb2pjvTZ3HfIgU", CreatedAt: mustParseTime("2013-10-02T10:12:29Z"), CanPush: false, LastUsedAt: mustParseTime("2024-10-03T01:32:21.992Z"), } assert.Equal(t, want, deployKey) } Loading