Skip to content
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

S3 content type user supplied #4895

Merged

Conversation

shinyhappydan
Copy link
Contributor

@shinyhappydan shinyhappydan commented Apr 23, 2024

Fixes #4881

@shinyhappydan shinyhappydan force-pushed the s3-content-type-user-supplied branch from 6106f74 to 26ba43b Compare April 23, 2024 14:12
private def parseContentType(raw: String): IO[ContentType] =
ContentType.parse(raw).map(_.pure[IO]).getOrElse(IO.raiseError(InvalidContentType(raw)))
private def parseContentType(raw: Option[String]): IO[Option[ContentType]] = {
raw match {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

traverse could be your friend here


def baseEndpoint: Uri
}

object S3StorageClient {

case class UploadMetadata(checksum: String, fileSize: Long, location: Uri)
case class HeadObject(
fileSize: Long,
contentType: Option[String],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could have directly a ContentType here

case class HeadObject(
fileSize: Long,
contentType: Option[String],
sha256Checksum: Option[String],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same it could be a Digest

@shinyhappydan shinyhappydan force-pushed the s3-content-type-user-supplied branch from 26ba43b to bf5af4e Compare April 24, 2024 13:25
@shinyhappydan
Copy link
Contributor Author

@imsdu I addressed one comment, but currently in merge hell and not sure about the others. I don't disagree with what you're saying I'm just going to avoid dealing with it for now, because they aren't blocking us

Copy link
Contributor

@dantb dantb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, probably some refactoring to do separately - would be good to have this merged so I can deal with the conflicts in the update PR too

@shinyhappydan shinyhappydan merged commit b303151 into BlueBrain:master Apr 24, 2024
6 checks passed
@shinyhappydan shinyhappydan deleted the s3-content-type-user-supplied branch April 24, 2024 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow user to provide content type for S3 file registration
3 participants