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

Generate file id on every download #72

Merged
merged 6 commits into from
Apr 29, 2015
Merged

Conversation

r38y
Copy link
Contributor

@r38y r38y commented Apr 29, 2015

I think page 36 of the following means the FileID should change when downloading a new file?

https://developer-static.intuit.com/qbSDK-current/doc/PDF/QBWC_proguide.pdf

@JasonBarnabe
Copy link
Contributor

As I understand it, you need a different FileID for each QuickBooks company file you want to access on your computer. I don't think generating a random one each time is what we want, because if you wanted to "reinstall" the connection, you'd download the .qwc file and give it to Web Connector, and wouldn't you end up with two entries?

It'd be better to have the configuration generator create a GUID for FileID, so every user of qbwc wouldn't have the same GUID, but at the same time an individual user would get the same GUID every time they downloaded the .qwc file.

@r38y
Copy link
Contributor Author

r38y commented Apr 29, 2015

Yeah, it looks like if there is a new FileID it will ask if you want to replace the current one, add a second application, or do nothing.

What about making it @file_id || SecureRandom.uuid so we can override it in the controller like the other ones? That way we can have one file_id per file we are managing.

@JasonBarnabe
Copy link
Contributor

I'd like to have FileID and OwnerID randomly generated when you run rails generate qbwc:install. If you'd like access to it in the controller, I'd accept a change for that too. Personally, I just manually edit the .qwc file.

@r38y
Copy link
Contributor Author

r38y commented Apr 29, 2015

Yeah, manually editing it is what I'm doing but I don't want to rely on
someone having to remember that in the future when another developer is
working on it. I'll update this to make it override-able.

On Wed, Apr 29, 2015 at 2:30 PM, Jason Barnabe notifications@github.com
wrote:

I'd like to have FileID and OwnerID randomly generated when you run rails
generate qbwc:install. If you'd like access to it in the controller, I'd
accept a change for that too. Personally, I just manually edit the .qwc
file.


Reply to this email directly or view it on GitHub
#72 (comment).

Randy Schmidt

@r38y
Copy link
Contributor Author

r38y commented Apr 29, 2015

How's that?

@JasonBarnabe
Copy link
Contributor

Can you make it a public method instead, and add documentation (I suppose under "Multiple users and multiple company files")?

@r38y
Copy link
Contributor Author

r38y commented Apr 29, 2015

I just tried setting the FileID to the MD5 of the file_path and it seems to work... and is pretty close to the meaning of that field, I think. What about using the MD5 of the file path by default?

@r38y
Copy link
Contributor Author

r38y commented Apr 29, 2015

I think this is what you meant. I got rid of manually editing the OwnerID because I think that line was wrong. The OwnerID is the id of the application being integrated with so it should always be the same for the same app.

@JasonBarnabe
Copy link
Contributor

I'm fairly sure that you need to change OwnerID if you have one Rails app, one QuickBooks file, but multiple users (on different machines) running Web Connector, so leave that paragraph alone.

Can you use the existing GUID instead of a random one? As I previously mentioned, I don't think it's right to have the FileID different each time you download it. Having one hard-coded one is not right either, but we can handle that in a separate issue by having the generator make one.

Since AppName needs to be unique as well, can you extract it out in the same way as you did FileID?

@r38y
Copy link
Contributor Author

r38y commented Apr 29, 2015

I had pulled that OwnerID from the PDF above where it says

You should generate one GUID per application only and not per application version or per QWC file!

I'll add back the paragraph since I'm not going to be manually updating the file.

I pulled the app name out too.

If you are connecting to multiple company files, you will additionally
need to change `AppName` and `FileID` (any GUID) to be unique to each
file. Alternatively you can override the `file_id` in the generated
`QbwcController` to supply your own `FileID` when generating the file.
Copy link
Contributor

Choose a reason for hiding this comment

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

Keep paragraphs together in a single line.

Drop the word "Alternatively" and make sure to mention app_name too.

JasonBarnabe added a commit that referenced this pull request Apr 29, 2015
Allow dynamic FileID and AppName
@JasonBarnabe JasonBarnabe merged commit a2ac611 into qbwc:master Apr 29, 2015
@JasonBarnabe
Copy link
Contributor

Filed #73 for not having hard-coded GUIDs. Thanks!

@r38y
Copy link
Contributor Author

r38y commented Apr 29, 2015

Sure! This gem has helped a lot, thank you!

On Wed, Apr 29, 2015 at 4:52 PM, Jason Barnabe notifications@github.com
wrote:

Filed #73 #73 for not having
hard-coded GUIDs. Thanks!


Reply to this email directly or view it on GitHub
#72 (comment).

Randy Schmidt

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.

None yet

2 participants