Giter Club home page Giter Club logo

Comments (27)

chaudharydeepak avatar chaudharydeepak commented on September 25, 2024 1

Hi @vikram-sahu , sure! i will take a look at this today and respond with any follow-up questions / possible solutions. At bare minimum, I think the application has to allow authentication to S3 on-behalf of user and using S3 exposed api's download / attach file to email - any size restrictions?

from pepipost-sdk-java.

chaudharydeepak avatar chaudharydeepak commented on September 25, 2024 1

Hi, today I finished basic functionality to allow S3 integration -

  1. defined an interface for 3rd party attachement source provider ( S3, dropbox(may be in future) etc. ).
  2. using aws S3 sdk did integration to fetch required files from defined buckets and attach to the email body. Happy path functionality worked - few more basic cases to consider:
    a. size limitations.
    b. working with encyrpted files on S3.

I used the S3 sdk provided by AWS. Let me know if this is ok, or should we directly invoke the rest apis without using sdk. Per AWS, using sdk is recommended way.

from pepipost-sdk-java.

chaudharydeepak avatar chaudharydeepak commented on September 25, 2024 1

I forked, see changes here -
https://github.com/chaudharydeepak/pepipost-sdk-java

Files:
com.pepipost.api.attachementProvider.AttachSourceProvider
com.pepipost.api.attachementProvider.S3AttachSourceProvider
com.pepipost.utils.PepipostUtil

from pepipost-sdk-java.

chaudharydeepak avatar chaudharydeepak commented on September 25, 2024 1

For now code changed to reflect for client side encrypted files with following schemes -
AWS KMS
AES Symmetric
RSA pub/pvt

Modified code at -
https://github.com/chaudharydeepak/pepipost-sdk-java

from pepipost-sdk-java.

chaudharydeepak avatar chaudharydeepak commented on September 25, 2024 1

Hi @vikram-sahu , your mentioned case should be mostly covered by scenario of client side encryption - wherein the files were encrypted using symmetric or assymetric cryptography before uploading to S3 by the client. Code is already in place for this to allow the users input AES(symmetric) or RSA(asymmetric) keys for decrypting S3 downloaded content, before attaching to the email. I will test some more cases.

Also, code is already in place for base64 conversion before attaching / transferring. I have been to send / verify multiple emails with attachements etc.

Please check modified code at -
https://github.com/chaudharydeepak/pepipost-sdk-java

from pepipost-sdk-java.

chaudharydeepak avatar chaudharydeepak commented on September 25, 2024 1

some sample code here -

		// 2 files in same bucket. They have no encryption applied.
		List< String > filesList_2 = new ArrayList< String >( );
		filesList_2.add( "BW_MEMO2-typeable.pdf" );
		// filesList_2.add( "Microservices_Patterns_v11.pdf" );
		FileObjects fileObjects_2 = new FileObjects( "myotherbucketforpepi", filesList_2 );
		fileObjects_2.setEncyrptionType( "NONE" );
		
		// A file in a bucket. Before uploading, the file was encyrpted using
		// AWS KMS key.
		// hence we need respective client to download / decrypt the data before
		// document is email attach ready.
		List< String > kms_encryptedFileList = new ArrayList< String >( );
		kms_encryptedFileList.add( "enc_file_kms.txt" );
		FileObjects kms_enc_files = new FileObjects( "myotherbucketforpepi", kms_encryptedFileList );
		kms_enc_files.setEncyrptionType( "AWSKMS" );
		kms_enc_files.setKms_cmk_id( "7c232025-9498-4959-83e5-153345e50ee5" );
		
		// A file in a bucket. Before uploading, the file was encyrpted using
		// AES Symmetric key.
		// hence we need respective client to download / decrypt the data before
		// document is email attach ready.
		List< String > aes_encryptedFileList = new ArrayList< String >( );
		aes_encryptedFileList.add( "enc_file_aes256.txt" );
		FileObjects aes_enc_files = new FileObjects( "myotherbucketforpepi", aes_encryptedFileList );
		aes_enc_files.setEncyrptionType( "AES" );
		aes_enc_files.setPath_to_keys( System.getProperty( "java.io.tmpdir" ) );
		aes_enc_files.setAes_master_keyName( "secret.key" );
		
		// A file in a bucket. Before uploading, the file was encyrpted using
		// RSA Asymmetric keys(pub / private).
		// hence we need respective client to download / decrypt the data before
		// document is email attach ready.
		List< String > rsa_encryptedFileList = new ArrayList< String >( );
		rsa_encryptedFileList.add( "enc_file_rsa10241.txt" );
		FileObjects rsa_enc_files = new FileObjects( "myotherbucketforpepi", rsa_encryptedFileList );
		rsa_enc_files.setEncyrptionType( "RSA" );
		rsa_enc_files.setPath_to_keys( System.getProperty( "java.io.tmpdir" ) );
		rsa_enc_files.setRsa_pub_keyName( "public.key" );
		rsa_enc_files.setRsa_pvt_keyName( "private.key" );

from pepipost-sdk-java.

chaudharydeepak avatar chaudharydeepak commented on September 25, 2024 1

@vikram-sahu committed code to S3_feature_addition branch on fork, and created a PR for QA.

from pepipost-sdk-java.

chaudharydeepak avatar chaudharydeepak commented on September 25, 2024

@geniusdibya please let me know if you still need help with above features? i would be more then happy to help out. Thank you.

from pepipost-sdk-java.

ivikramsahu avatar ivikramsahu commented on September 25, 2024

Yes @chaudharydeepak we still looking for above feature and you are most welcomed for contribution.

from pepipost-sdk-java.

ivikramsahu avatar ivikramsahu commented on September 25, 2024

yes, we have to restrict size which can be > 10MB. And you can reach out to us anytime for any questions or query related to feature in this thread or email us to [email protected]

from pepipost-sdk-java.

chaudharydeepak avatar chaudharydeepak commented on September 25, 2024

Thank you VIkram - i sent an email to [email protected] from my personal email account with few questions. @vikram-sahu

from pepipost-sdk-java.

ivikramsahu avatar ivikramsahu commented on September 25, 2024

Hi, today I finished basic functionality to allow S3 integration -

1. defined an interface for 3rd party attachement source provider ( S3, dropbox(may be in future) etc. ).

2. using aws S3 sdk did integration to fetch required files from defined buckets and attach to the email body. Happy path functionality worked - few more basic cases to consider:
   a. size limitations.
   b. working with encyrpted files on S3.

I used the S3 sdk provided by AWS. Let me know if this is ok, or should we directly invoke the rest apis without using sdk. Per AWS, using sdk is recommended way.

you can use S3 sdk provided by AWS and i have gone through your email and replied for the same please check and let me know if any help required.

from pepipost-sdk-java.

chaudharydeepak avatar chaudharydeepak commented on September 25, 2024

Thank you @vikram-sahu . I will go ahead with AWS SDK approach.

S3 allows server-side encryption [ i.e. the files stored encrypted at rest ], as well as client side ecnyrption [ i.e. the files are encrypted before transferring over ]. Do we want to consider these functionalities as well? More info here - https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingEncryption.html

from pepipost-sdk-java.

ivikramsahu avatar ivikramsahu commented on September 25, 2024

Thank you @vikram-sahu . I will go ahead with AWS SDK approach.

S3 allows server-side encryption [ i.e. the files stored encrypted at rest ], as well as client side ecnyrption [ i.e. the files are encrypted before transferring over ]. Do we want to consider these functionalities as well? More info here - https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingEncryption.html

hey @chaudharydeepak, encryption is not needed as of now.
But what if the client has kept data in an encrypted format on the disk? and while getting the data from the S3 bucket how will you decrypt the file? otherwise, the file will be broken. Moreover, you need to encode the file content in the base64 format before you pass to pepipost API else you won't able to open the file sent on mail.

from pepipost-sdk-java.

chaudharydeepak avatar chaudharydeepak commented on September 25, 2024

Additionally, possibly, the file can be encrypted using interesting ways ( for ex. password protected pdf / word doc etc ), I think we need to approach this as following -

  1. If we allow file decryption directly from S3( first download file, then decrypt, then base64 encode, then attach), we need to define exactly what kind of decryption we support and how the file originally would have been encrypted - algorithms / crypto tech etc. So, for this I will need exact specifics and we can code accordingly.

  2. Else, since we are building sdk, we simply allow users to download file from S3 ( encrypted or not ) and the users handle decryption on their own as they would know how the file was encrypted originally.

my 2 cents - bottom line, we need to define exact expected funtionality. For now, code is already in place to allow the users input AES(symmetric) or RSA(asymmetric) keys for decrypting S3 downloaded content, before attaching to the email. This works for AWS S3 SDK encrypted files.

from pepipost-sdk-java.

ivikramsahu avatar ivikramsahu commented on September 25, 2024

Additionally, possibly, the file can be encrypted using interesting ways ( for ex. password protected pdf / word doc etc ), I think we need to approach this as following -

1. If we allow file decryption directly from S3( first download file, then decrypt, then base64 encode, then attach), we need to define exactly what kind of decryption we support and how the file originally would have been encrypted - algorithms / crypto tech etc. So, for this I will need exact specifics and we can code accordingly.

2. Else, since we are building sdk, we simply allow users to download file from S3 ( encrypted or not ) and the users handle decryption on their own as they would know how the file was encrypted originally.

my 2 cents - bottom line, we need to define exact expected funtionality. For now, code is already in place to allow the users input AES(symmetric) or RSA(asymmetric) keys for decrypting S3 downloaded content, before attaching to the email. This works for AWS S3 SDK encrypted files.

I think point 2 will work as per our expectation where the client should handle decryption on their own. Moreover, once you are done with the SDK can you also mention the README.md file for the S3 functionality you have added in the following SDK.

from pepipost-sdk-java.

chaudharydeepak avatar chaudharydeepak commented on September 25, 2024

Sure @vikram-sahu . how should I approach committing the code? currently i have forked from current and making changes there.

Also, I will write some unit testing with few scenarios.

from pepipost-sdk-java.

ivikramsahu avatar ivikramsahu commented on September 25, 2024

Sure @vikram-sahu . how should I approach committing the code? currently i have forked from current and making changes there.

Also, I will write some unit testing with few scenarios.

perfect @chaudharydeepak, you can check out a new branch name "S3 feature addition" and commit on that branch once you have completed development you can create a PR after that we can have a QA and merge with master.

from pepipost-sdk-java.

ivikramsahu avatar ivikramsahu commented on September 25, 2024

@chaudharydeepak great.! let me check and have a look.

from pepipost-sdk-java.

chaudharydeepak avatar chaudharydeepak commented on September 25, 2024

@vikram-sahu - any feedback here? Please let me know if there are any review comments. Thank you.

from pepipost-sdk-java.

ivikramsahu avatar ivikramsahu commented on September 25, 2024

@vikram-sahu - any feedback here? Please let me know if there are any review comments. Thank you.

Hey @chaudharydeepak, we are still in the QA phase will let you know in case of any kind of feedback.

from pepipost-sdk-java.

chaudharydeepak avatar chaudharydeepak commented on September 25, 2024

@vikram-sahu got it! Thank you.

from pepipost-sdk-java.

chaudharydeepak avatar chaudharydeepak commented on September 25, 2024

@vikram-sahu looks like the changes were pulled in to your master branch?

from pepipost-sdk-java.

ravifrnds09 avatar ravifrnds09 commented on September 25, 2024

Hi Sir,
Can you please provide code for sending attachment with pepipost

from pepipost-sdk-java.

ivikramsahu avatar ivikramsahu commented on September 25, 2024

@vikram-sahu looks like the changes were pulled in to your master branch?

hey @chaudharydeepak, we have successfully deployed your contribution!

from pepipost-sdk-java.

ivikramsahu avatar ivikramsahu commented on September 25, 2024

Hi Sir,
Can you please provide code for sending attachment with pepipost

from pepipost-sdk-java.

chaudharydeepak avatar chaudharydeepak commented on September 25, 2024

from pepipost-sdk-java.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.