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

autoendpoint: modify FCMCredentials to accept String #254

Closed
oremj opened this issue Feb 26, 2021 · 3 comments · Fixed by #255 or #263
Closed

autoendpoint: modify FCMCredentials to accept String #254

oremj opened this issue Feb 26, 2021 · 3 comments · Fixed by #255 or #263
Assignees
Labels
3 Estimate - Small...ish

Comments

@oremj
Copy link
Contributor

oremj commented Feb 26, 2021

Can we modify FCM credentials to accept a string instead of PathBuf? It looks like the yup_oauth2 library only supports a Path in read_service_account_key, but perhaps we could create a temp file out of the auth file string and pass that to the library?

@jrconlin
Copy link
Member

Maybe? Kind of the point you're making here. There might be a way to do it using file handoffs, but it's going to be messy because I don't always know if I have write access.

I can try writing to /tmp but I wonder if that might be a security concern.

@jrconlin jrconlin self-assigned this Feb 26, 2021
@jrconlin jrconlin added the 3 Estimate - Small...ish label Feb 26, 2021
@pjenvey
Copy link
Member

pjenvey commented Feb 26, 2021

The ServiceAccountKey it returns is just a json deserialization of the creds and it's public, so we should be able to just deserialize directly to it from the env String.

See the read_service_account_key code for what I mean

@oremj
Copy link
Contributor Author

oremj commented Feb 26, 2021

The ServiceAccountKey it returns is just a json deserialization of the creds and it's public, so we should be able to just deserialize directly to it from the env String.

See the read_service_account_key code for what I mean

This is a good point and likely a good way around the tmp file solution.

jrconlin added a commit that referenced this issue Feb 27, 2021
FCM credentials are now specified as a JSON structure with an embedded
credential string. Please note that additional escaping may be required.
the original `auth_file` parameter is now deprecated.

As per above, please specify the FCM credential file content as an
included String. Additional string escapes may be required to properly
specify the inline JSON.

Closes #254
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 Estimate - Small...ish
Projects
None yet
3 participants