Skip to content

feat: bundling the public key in the artifact for android #44

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

Merged
merged 5 commits into from
May 7, 2024

Conversation

erickzanardo
Copy link

Adds logic to bundle a public key in the binary. Which afterwards can be used in the updater to validate patch signatures.

In this first POC we discussed to make the flow very simple. If there is a public.pem file in the root of the flutter project. It will be added, encoded in base64 into the "internal" shorebird.yaml.

iOS change will follow.

Comment on lines 1198 to 1200
def base64EncodedKey = Base64.getEncoder().encode(publicKeyFile.readBytes());
content += 'patch_public_key: ' + new String(base64EncodedKey) + '\n';
}
Copy link

Choose a reason for hiding this comment

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

I think the public key just ends up as a flutter asset? Or is the idea to include the content of the key in the shorebird.yaml itself?

Copy link
Author

Choose a reason for hiding this comment

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

The later, to include the key (as base64) into the "final" shorebird.yaml

@eseidel
Copy link

eseidel commented May 7, 2024

Discussed in person, we're going to change this to expect an environment variable to have the key that we then just set in this shorebird.yaml.

e.g. essentially:

patch_public_key: $SHOREBIRD_PATCH_KEY

@eseidel
Copy link

eseidel commented May 7, 2024

We will then also have to change shorebird to do the base64 and pass it down through the ENV.

@@ -28,7 +28,6 @@ import org.gradle.api.tasks.Optional
import org.gradle.api.tasks.TaskAction
import org.gradle.api.tasks.bundling.Jar
import org.gradle.internal.os.OperatingSystem
import org.gradle.util.VersionNumber
Copy link
Author

Choose a reason for hiding this comment

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

Was unused

@erickzanardo erickzanardo requested a review from eseidel May 7, 2024 19:57
@erickzanardo erickzanardo merged commit 431df55 into shorebird/dev May 7, 2024
1 of 4 checks passed
@erickzanardo erickzanardo deleted the ez/bundling-public-key-into-artifact branch May 7, 2024 20:05
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.

2 participants