Coder Social home page Coder Social logo

Comments (20)

valr2 avatar valr2 commented on August 11, 2024 3

I did manage to get a test pin ('1234') into Firestore, by adding a line at the beginning of getUploadToken() in getUploadToken.ts, that calls "await storeUploadCodes(['1234']);". Afterwards I could see in Cloud Firestore Database a "codes" collection, with an "uploadCode" document.

After doing this, the app still said Invalid Pin, although getUploadToken() executed successfully on the server and returned status: "SUCCESS" and the base64 encoded token to the client. The reason was an exception on the client-side related to SimpleDateFormat('YYYYMMdd') in uploadToCloudStorage() from EnterPinFragment.kt. I've changed the format string to 'yyyyMMdd' and now the whole uploading works, and I see my data inside the upload storage bucket, as unencrypted json.

from opentrace-android.

rinekri avatar rinekri commented on August 11, 2024 1

@lorsk You can add logging of encryption key from SecretManager in the encrypt function. Maybe problem isn't in key itself, but in the way how you added it in the Manager. You could copy key with spaces, new lines and etc.

from opentrace-android.

slxe6 avatar slxe6 commented on August 11, 2024

Hi simonry14, the getUploadToken requires a pin that is generated on the server. You need to enter this pin in order to upload. Can you double check that you entered the correct pin?

from opentrace-android.

rinekri avatar rinekri commented on August 11, 2024

Yeah, you should generate a bunch of pin codes to upload data. You can use setUploadCodes function from getUploadToken.ts file. But to invoke it you should make some changes to source code, now it's just an unused function.

from opentrace-android.

rinekri avatar rinekri commented on August 11, 2024

And I remembered one important thing. I added in the getUploadToken.ts function trimming logic:

valid = uploadCodes.find(x => x.trim() === data.trim()) !== undefined;
It will protect you from insufficient error if you entered spaces accidentally.

from opentrace-android.

rez20004 avatar rez20004 commented on August 11, 2024

@ValentinRadoi can you please share how the code look like that you the added the await storeUploadCodes(['1234']);
thanks in advance.

from opentrace-android.

simonry14 avatar simonry14 commented on August 11, 2024

Thanks all for the feedback. I resolved it by following @ValentinRadoi's advice.

from opentrace-android.

esQmo avatar esQmo commented on August 11, 2024

Hey @simonry14 , It will be better if you share your solution with others too

from opentrace-android.

Biplovkumar avatar Biplovkumar commented on August 11, 2024

undefined

Can u plz share @rinekri
Where it need to be add ?

from opentrace-android.

Biplovkumar avatar Biplovkumar commented on August 11, 2024

Thanks all for the feedback. I resolved it by following @ValentinRadoi's advice.

Can u plz share the solution with class name. @simonry14

from opentrace-android.

Hoangtho11188 avatar Hoangtho11188 commented on August 11, 2024

@rinekri I'm facing with the below issue when trying to upload data :
Error: 9 FAILED_PRECONDITION: The Cloud Firestore API is not available for Datastore Mode projects.
Could you pls help me on this?

from opentrace-android.

Biplovkumar avatar Biplovkumar commented on August 11, 2024

I did manage to get a test pin ('1234') into Firestore, by adding a line at the beginning of getUploadToken() in getUploadToken.ts, that calls "await storeUploadCodes(['1234']);". Afterwards I could see in Cloud Firestore Database a "codes" collection, with an "uploadCode" document.

After doing this, the app still said Invalid Pin, although getUploadToken() executed successfully on the server and returned status: "SUCCESS" and the base64 encoded token to the client. The reason was an exception on the client-side related to SimpleDateFormat('YYYYMMdd') in uploadToCloudStorage() from EnterPinFragment.kt. I've changed the format string to 'yyyyMMdd' and now the whole uploading works, and I see my data inside the upload storage bucket, as unencrypted json.

Not helped @valr2.
i hev entered verification code in Enter pin number and changed 'yyyyMMdd' too.
but still facing issue.

from opentrace-android.

rinekri avatar rinekri commented on August 11, 2024

@Hoangtho11188 It seems you should change Firestore Mode to Native.

from opentrace-android.

lorsk avatar lorsk commented on August 11, 2024

I did manage to get a test pin ('1234') into Firestore, by adding a line at the beginning of getUploadToken() in getUploadToken.ts, that calls "await storeUploadCodes(['1234']);". Afterwards I could see in Cloud Firestore Database a "codes" collection, with an "uploadCode" document.

After doing this, the app still said Invalid Pin, although getUploadToken() executed successfully on the server and returned status: "SUCCESS" and the base64 encoded token to the client. The reason was an exception on the client-side related to SimpleDateFormat('YYYYMMdd') in uploadToCloudStorage() from EnterPinFragment.kt. I've changed the format string to 'yyyyMMdd' and now the whole uploading works, and I see my data inside the upload storage bucket, as unencrypted json.

This has not worked for me. I added the await storeUploadCodes(['1234']); line to see if that helps but its giving me this Invalid key length error:

image

from opentrace-android.

rinekri avatar rinekri commented on August 11, 2024

I did manage to get a test pin ('1234') into Firestore, by adding a line at the beginning of getUploadToken() in getUploadToken.ts, that calls "await storeUploadCodes(['1234']);". Afterwards I could see in Cloud Firestore Database a "codes" collection, with an "uploadCode" document.

After doing this, the app still said Invalid Pin, although getUploadToken() executed successfully on the server and returned status: "SUCCESS" and the base64 encoded token to the client. The reason was an exception on the client-side related to SimpleDateFormat('YYYYMMdd') in uploadToCloudStorage() from EnterPinFragment.kt. I've changed the format string to 'yyyyMMdd' and now the whole uploading works, and I see my data inside the upload storage bucket, as unencrypted json.

This has not worked for me. I added the await storeUploadCodes(['1234']); line to see if that helps but its giving me this Invalid key length error:

image

Code should have minimum 6 symbols, try to add 123456 code number.

from opentrace-android.

lorsk avatar lorsk commented on August 11, 2024

Code should have minimum 6 symbols, try to add 123456 code number.

Hey @rinekri tried that and am getting the same thing unfortunately. What do you think I am missing?

image

from opentrace-android.

lorsk avatar lorsk commented on August 11, 2024

After some investigating, the Invalid key length is coming from the key I generated and uploaded to the Secret Manager. I have set it up correctly I believe and it passes all my tests. My default encryption algorithm is "aes-256-gcm".

Not sure where I am going wrong.

EDIT:
I was able to successfully upload a key by doing this
const key_in_bytes = Buffer.from("FKdDh0d0qUv4FByKxwkZtCPfR87uspUwEokBFRQll5w=", 'base64')
and passing that instead of this.key

image
(And similar thing with the same base64 string to the decrypt function)

This means I did something weird with how I generated the key possibly with the head -c32 /dev/urandom | base64 line

So still not sure what the issue there is.

from opentrace-android.

Hoangtho11188 avatar Hoangtho11188 commented on August 11, 2024

@rinekri I getuploadtoken success from my side
uploadtoken
So how to upload data to Storage bucket? My Upload bucket still is empty now.

from opentrace-android.

vishaljoseph avatar vishaljoseph commented on August 11, 2024

@Hoangtho11188 I'm having the same issue. Getting this error on checking the logs: E/StorageException: StorageException has occurred.
User does not have permission to access this object.
Code: -13021 HttpResult: 403
E/StorageException: The server has terminated the upload session

Were you able to fix it?

from opentrace-android.

 avatar commented on August 11, 2024

"await storeUploadCodes(['1234']);"

hello, can you please specify where did you put this "await storeUploadCodes(['1234']);" line? It will be extremely helpful. Thank you.

from opentrace-android.

Related Issues (20)

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.