
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@caliatys/s3-service
Advanced tools
This Angular Library, which currently supports Angular 6.x and 7.x, is a wrapper around the aws-sdk libraries to easily manage your S3 buckets.
git clone https://github.com/Caliatys/S3Service
cd S3Service/
npm install
Don't forget to edit the parameters located in src/app/shared/consts/s3.const.ts.
ng build s3-service --prod
ng serve
Add @caliatys/s3-service module as dependency to your project.
npm install @caliatys/s3-service --save
Copy/paste src/app/shared/consts/s3.const.ts and replace the parameters with your resource identifiers.
export const S3Const = {
bucket : 'XXXXXXXXXXXXXXX'
};
Copy/paste src/app/shared/helpers/s3.helper.ts. This file is used to simplify the implementation of the S3Service in your application while keeping a single instance of it.
// Angular modules
import { Injectable } from '@angular/core';
// External modules
import { S3Service } from '@caliatys/s3-service';
// Consts
import { S3Const } from '../consts/s3.const';
@Injectable()
export class S3Helper
{
// Services
public s3Service : S3Service = new S3Service(S3Const);
// Consts
public s3Const = S3Const;
}
Include S3Helper into the providers of app.module.ts :
...
import { S3Helper } from './shared/helpers/s3.helper';
@NgModule({
...
providers :
[
S3Helper
...
],
...
})
export class AppModule { }
export class S3Object
{
public Key : string;
public Name : string;
public Extension : string;
public Output : AWS.S3.GetObjectOutput;
public Blob : Blob;
}
Retrieves objects from Amazon S3.
this.s3Helper.s3Service.getObject('objectKey.json').then(res => {}).catch(err => {});
Adds an object to a bucket.
this.s3Helper.s3Service.putObject(item, 'objectKey.json').then(res => {}).catch(err => {});
Creates a copy of an object that is already stored in Amazon S3.
this.s3Helper.s3Service.copyObject('objectKey.json', 'newKey.json').then(res => {}).catch(err => {});
this.s3Helper.s3Service.deleteObject('objectKey.json').then(res => {}).catch(err => {});
let del : AWS.S3.Delete;
del.Objects = [];
del.Objects.push({ Key : 'objectKey1.json' });
del.Objects.push({ Key : 'objectKey2.json', VersionId : 'XXXXXXXXX' });
this.s3Helper.s3Service.deleteObjects(del).then(res => {}).catch(err => {});
this.s3Helper.s3Service.listObjects().then(res => {}).catch(err => {});
// or
this.s3Helper.s3Service.listObjectsV2().then(res => {}).catch(err => {});
this.s3Helper.s3Service.listObjectVersions('objectPrefix').then(res => {}).catch(err => {});
this.s3Helper.s3Service.restoreObject('objectKey.json').then(res => {}).catch(err => {});
this.s3Helper.s3Service.getFolderObjects('image-folder').then(res => {}).catch(err => {});
this.s3Helper.s3Service.copyFolderObjects('from-folder', 'to-folder').then(res => {}).catch(err => {});
Important : This project uses the following dependencies :
"peerDependencies" : {
"@angular/common" : "^6.0.0 || ^7.0.0",
"@angular/core" : "^6.0.0 || ^7.0.0",
"rxjs" : "^6.0.0",
"rxjs-compat" : "^6.0.0",
"aws-sdk" : "^2.247.1"
},
"devDependencies" : {
"@types/node" : "10.12.0"
}
If it's an empty Angular application :
"types": ["node"] to the tsconfig.app.json file that the angular-cli creates in the src directory.(window as any).global = window; to the polyfills.ts file, as mentioned here : angular/angular-cli#9827 (comment)Contributions are welcome, please open an issue and preferably submit a pull request.
S3Service is built with Angular CLI.
FAQs
Typescript service for AWS S3 with Angular
We found that @caliatys/s3-service demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.