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

Bug 1950203 - Add a behavior that notarizes openh264 plugins for macosx #1138

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions signingscript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ This is a best effort list of supported signing formats and what they correspond
- `autograph_rsa`: get a detached signature for a file using autograph's hash signing endpoint
- `apple_notarization`: notarize and staple a mac pkg or tarball
- `apple_notarization_geckodriver`: notarize a mac binary (without stapling)
- `apple_notarize_openh264_plugin`: notarize a mac openh264 plugin (without stapling)


Testing
Expand Down
4 changes: 3 additions & 1 deletion signingscript/src/signingscript/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ async def async_main(context):
if not context.config.get("widevine_cert"):
raise Exception("Widevine format is enabled, but widevine_cert is not defined")

if {"apple_notarization", "apple_notarization_geckodriver", "apple_notarization_stacked"}.intersection(all_signing_formats):
if {"apple_notarization", "apple_notarization_geckodriver", "apple_notarization_stacked", "apple_notarize_openh264_plugin"}.intersection(
all_signing_formats
):
if not context.config.get("apple_notarization_configs", False):
raise Exception("Apple notarization is enabled but apple_notarization_configs is not defined")
setup_apple_notarization_credentials(context)
Expand Down
20 changes: 20 additions & 0 deletions signingscript/src/signingscript/sign.py
Original file line number Diff line number Diff line change
Expand Up @@ -1541,6 +1541,13 @@ async def _notarize_geckodriver(context, path, workdir):
return path


async def _notarize_openh264_plugin(context, path, workdir):
"""Notarizes an openh264 plugin binary"""
# the artifact from the openh264 plugin build task is already a .zip file
await _notarize_single(path, context.apple_credentials_path, staple=False)
return path


async def _notarize_all(context, path, workdir):
"""
Notarizes all files in a tarball
Expand Down Expand Up @@ -1603,6 +1610,19 @@ async def apple_notarize_geckodriver(context, path, *args, **kwargs):
return await _notarize_geckodriver(context, path, notarization_workdir)


@time_async_function
async def apple_notarize_openh264_plugin(context, path, *args, **kwargs):
"""
Notarizes given geckodriver package using rcodesign.
Copy link
Contributor

Choose a reason for hiding this comment

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

s/geckodriver/openh264

Also.. should we just move the _notarize_openh264_plugin logic inside this function?

"""
# Setup workdir
notarization_workdir = os.path.join(context.config["work_dir"], "apple_notarize")
shutil.rmtree(notarization_workdir, ignore_errors=True)
utils.mkdir(notarization_workdir)

return await _notarize_openh264_plugin(context, path, notarization_workdir)


@time_async_function
async def apple_notarize_stacked(context, filelist_dict):
"""
Expand Down
2 changes: 2 additions & 0 deletions signingscript/src/signingscript/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from signingscript.sign import (
apple_notarize,
apple_notarize_geckodriver,
apple_notarize_openh264_plugin,
apple_notarize_stacked, # noqa: F401
sign_authenticode,
sign_file,
Expand Down Expand Up @@ -57,6 +58,7 @@
"widevine": sign_widevine,
"apple_notarization": apple_notarize,
"apple_notarization_geckodriver": apple_notarize_geckodriver,
"apple_notarization_openh264_plugin": apple_notarize_openh264_plugin,
"macapp": sign_macapp,
# This format is handled in script.py
# Should be refactored in https://github.com/mozilla-releng/scriptworker-scripts/issues/980
Expand Down