Verified Commit 9f725464 authored by José M. Requena Plens's avatar José M. Requena Plens Committed by GitLab
Browse files

feat(secure_files): add FileExtension to SecureFile

Changelog: Improvements
parent ab6093d6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@ type SecureFile struct {
	CreatedAt         *time.Time          `json:"created_at"`
	ExpiresAt         *time.Time          `json:"expires_at"`
	Metadata          *SecureFileMetadata `json:"metadata"`
	FileExtension     string              `json:"file_extension"`
}

// SecureFileMetadata represents the metadata for a secure file.
+12 −4
Original line number Diff line number Diff line
@@ -26,7 +26,8 @@ func TestSecureFiles_ListProjectSecureFiles(t *testing.T) {
					"checksum_algorithm": "sha256",
					"created_at": "2022-02-22T22:22:22.000Z",
					"expires_at": null,
					"metadata": null
					"metadata": null,
					"file_extension": "jks"
				},
				{
					"id": 2,
@@ -51,7 +52,8 @@ func TestSecureFiles_ListProjectSecureFiles(t *testing.T) {
							"UID":"ABC123XYZ"
						},
						"expires_at":"2023-09-21T14:55:59.000Z"
					}
					},
					"file_extension": "cer"
				}
			]
		`)
@@ -68,6 +70,7 @@ func TestSecureFiles_ListProjectSecureFiles(t *testing.T) {
			CreatedAt:         &createdAt,
			ExpiresAt:         nil,
			Metadata:          nil,
			FileExtension:     "jks",
		},
		{
			ID:                2,
@@ -93,6 +96,7 @@ func TestSecureFiles_ListProjectSecureFiles(t *testing.T) {
				},
				ExpiresAt: &expiresAt,
			},
			FileExtension: "cer",
		},
	}

@@ -116,7 +120,8 @@ func TestSecureFiles_ShowSecureFileDetails(t *testing.T) {
				"checksum_algorithm": "sha256",
				"created_at": "2022-02-22T22:22:22.000Z",
				"expires_at": null,
				"metadata": null
				"metadata": null,
				"file_extension": "jks"
			}
		`)
	})
@@ -130,6 +135,7 @@ func TestSecureFiles_ShowSecureFileDetails(t *testing.T) {
		CreatedAt:         &createdAt,
		ExpiresAt:         nil,
		Metadata:          nil,
		FileExtension:     "jks",
	}

	file, resp, err := client.SecureFiles.ShowSecureFileDetails(1, 2)
@@ -154,7 +160,8 @@ func TestSecureFiles_CreateSecureFile(t *testing.T) {
				"checksum_algorithm": "sha256",
				"created_at": "2022-02-22T22:22:22.0Z",
				"expires_at": null,
				"metadata": null
				"metadata": null,
				"file_extension": "jks"
			}
		`)
	})
@@ -168,6 +175,7 @@ func TestSecureFiles_CreateSecureFile(t *testing.T) {
		CreatedAt:         &createdAt,
		ExpiresAt:         nil,
		Metadata:          nil,
		FileExtension:     "jks",
	}

	b := strings.NewReader("dummy")