![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
mime_message_composer
Advanced tools
Mime / Multipart message composer is a package that helps to encode the request body in a multipart message format. This composer helps to create the multipart encoded body like multipart/alternative.
This package works on a concept of content type. Every mutipart message hava a content type that describe what content it holds.
This package exposes two classes:
multipart/alternative
, multipart/mixed
, and otherstext/plain
, application/json
, and othersBranchableCT
BranchableCT(ContentType:String, Boundary:String) - E.g: BranchableCT("multipart/alternative","alt_part1")
appendHeaders(headers: HeaderType[]):this - E.g appendHeaders([{name:"Content-Transfer-Encoding",value:"base64"}])
- HeaderType is a Object that has name and value property.
- Used to add headers to the content type.
addBranches(branches: ContentTypeI[]):this - E.g: addBranches([new BranchableCT(..), new BodyCT(..)])
- Add subBranch of this content type
- ContentTypeI interface is implemented by both Branchable and Body Interface.
compile():string - E.g: compile()
- Generate the compiled Mime message of this content type by combining with headers and branches.
BodyCT
BodyCT(ContentType:String, additionalCT: HeaderType) - E.g BodyCT("application/json",{name:"name",value:"package.json"})
appendHeaders(headers: HeaderType[]):this - E.g appendHeaders([{name:"Content-Transfer-Encoding",value:"base64"}])
- HeaderType is a Object that has name and value property.
- Used to add headers to the content type.
getBody():string - eg getBody()
- Get Body data added to this content type class
setBody(data: string):this - E.g: setBody("any data depending on headers")
- Add body data to the content type.
compile():string - E.g: compile()
- Generate the compiled Mime message of this content type by combining with headers and branches.
const textPlain = new BodyCT({
contentType: "text/plain",
additionalCT: {
name: "charset",
value: "UTF-8"
}
}).appendHeaders([
{
name: "Content-Transfer-Encoding",
value: "7bit"
}
]).setBody("this is plain text body");
const textHtml = new BodyCT({
contentType: "text/html",
additionalCT: {
name: "charset",
value: "UTF-8"
}
}).appendHeaders([
{
name: "Content-Transfer-Encoding",
value: "7bit"
}
]).setBody("<b>this is plain text body</b>");
const alternative = new BranchableCT({
contentType: "multipart/alternative",
boundary: "foo-bar"
}).appendHeaders([
{
name: "Encoding",
value: "7bit"
}
]).addBranches([textPlain, textHtml]);
console.log(alternative.compile())
Output:
Content-Type: multipart/alternative; boundary="foo-bar"
Encoding: 7bit
--foo-bar
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
this is plain text body
--foo-bar
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: 7bit
<b>this is plain text body</b>
--foo-bar--
FAQs
multipare encoded content composer
The npm package mime_message_composer receives a total of 44 weekly downloads. As such, mime_message_composer popularity was classified as not popular.
We found that mime_message_composer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.