mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-10 17:21:34 +00:00
add privacy statement to CLI (#695)
This commit is contained in:
parent
d57abb6956
commit
14b295f337
3
.github/workflows/ci.yml
vendored
3
.github/workflows/ci.yml
vendored
@ -87,8 +87,9 @@ jobs:
|
|||||||
python setup.py sdist bdist_wheel
|
python setup.py sdist bdist_wheel
|
||||||
pip install -r ./requirements.txt ../../artifacts/sdk/*.whl
|
pip install -r ./requirements.txt ../../artifacts/sdk/*.whl
|
||||||
pip install six
|
pip install six
|
||||||
pyinstaller onefuzz/__main__.py --onefile --name onefuzz --additional-hooks-dir extra/pyinstaller --hidden-import='pkg_resources.py2_warn' --exclude-module tkinter --exclude-module PySide2 --exclude-module PIL.ImageDraw --exclude-module Pillow --clean
|
pyinstaller onefuzz/__main__.py --onefile --name onefuzz --additional-hooks-dir extra/pyinstaller --hidden-import='pkg_resources.py2_warn' --exclude-module tkinter --exclude-module PySide2 --exclude-module PIL.ImageDraw --exclude-module Pillow --clean --add-data "onefuzz/data/privacy.txt;onefuzz/data" --add-data "onefuzz/data/licenses.json;onefuzz/data"
|
||||||
./dist/onefuzz.exe --version
|
./dist/onefuzz.exe --version
|
||||||
|
./dist/onefuzz.exe privacy_statement
|
||||||
mkdir -p ${GITHUB_WORKSPACE}/artifacts/windows-cli/
|
mkdir -p ${GITHUB_WORKSPACE}/artifacts/windows-cli/
|
||||||
mkdir -p ${GITHUB_WORKSPACE}/artifacts/sdk/
|
mkdir -p ${GITHUB_WORKSPACE}/artifacts/sdk/
|
||||||
cp dist/*.tar.gz dist/*.whl ${GITHUB_WORKSPACE}/artifacts/sdk/
|
cp dist/*.tar.gz dist/*.whl ${GITHUB_WORKSPACE}/artifacts/sdk/
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
include LICENSE
|
include LICENSE
|
||||||
include *.txt
|
include *.txt
|
||||||
include *.md
|
include *.md
|
||||||
graft examples
|
include extra/pyinstaller/*.py
|
||||||
|
include onefuzz/data/privacy.txt
|
||||||
|
include onefuzz/data/licenses.json
|
||||||
|
graft examples
|
8
src/cli/extra/pyinstaller/hook-onefuzz.py
Normal file
8
src/cli/extra/pyinstaller/hook-onefuzz.py
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
#
|
||||||
|
# Copyright (c) Microsoft Corporation.
|
||||||
|
# Licensed under the MIT License.
|
||||||
|
|
||||||
|
from PyInstaller.utils.hooks import collect_data_files
|
||||||
|
|
||||||
|
datas = collect_data_files("onefuzz")
|
@ -6,6 +6,7 @@
|
|||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
import pkgutil
|
||||||
import re
|
import re
|
||||||
import subprocess # nosec
|
import subprocess # nosec
|
||||||
import uuid
|
import uuid
|
||||||
@ -14,7 +15,6 @@ from shutil import which
|
|||||||
from typing import Callable, Dict, List, Optional, Tuple, Type, TypeVar
|
from typing import Callable, Dict, List, Optional, Tuple, Type, TypeVar
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
import pkg_resources
|
|
||||||
import semver
|
import semver
|
||||||
from memoization import cached
|
from memoization import cached
|
||||||
from onefuzztypes import (
|
from onefuzztypes import (
|
||||||
@ -1530,8 +1530,17 @@ class Onefuzz:
|
|||||||
|
|
||||||
def licenses(self) -> object:
|
def licenses(self) -> object:
|
||||||
""" Return third-party licenses used by this package """
|
""" Return third-party licenses used by this package """
|
||||||
stream = pkg_resources.resource_stream(__name__, "data/licenses.json")
|
data = pkgutil.get_data("onefuzz", "data/licenses.json")
|
||||||
return json.load(stream)
|
if data is None:
|
||||||
|
raise Exception("missing licenses.json")
|
||||||
|
return json.loads(data)
|
||||||
|
|
||||||
|
def privacy_statement(self) -> bytes:
|
||||||
|
""" Return OneFuzz privacy statement """
|
||||||
|
data = pkgutil.get_data("onefuzz", "data/privacy.txt")
|
||||||
|
if data is None:
|
||||||
|
raise Exception("missing licenses.json")
|
||||||
|
return data
|
||||||
|
|
||||||
def logout(self) -> None:
|
def logout(self) -> None:
|
||||||
""" Logout of Onefuzz """
|
""" Logout of Onefuzz """
|
||||||
|
14
src/cli/onefuzz/data/privacy.txt
Normal file
14
src/cli/onefuzz/data/privacy.txt
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
The software may collect information about you and your use of the software and
|
||||||
|
send it to Microsoft. Microsoft may use this information to provide services
|
||||||
|
and improve our products and services. You may turn off the telemetry as
|
||||||
|
described in the repository. There are also some features in the software that
|
||||||
|
may enable you and Microsoft to collect data from users of your applications.
|
||||||
|
If you use these features, you must comply with applicable law, including
|
||||||
|
providing appropriate notices to users of your applications together with a
|
||||||
|
copy of Microsoft's privacy statement. Our privacy statement is located at
|
||||||
|
https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data
|
||||||
|
collection and use in the help documentation and our privacy statement. Your
|
||||||
|
use of the software operates as your consent to these practices.
|
||||||
|
|
||||||
|
Instructions on how to turn off telemetry:
|
||||||
|
* https://github.com/microsoft/onefuzz/blob/main/docs/telemetry.md#how-to-disable-sending-telemetry-to-microsoft
|
@ -44,5 +44,7 @@ setuptools.setup(
|
|||||||
install_requires=requirements,
|
install_requires=requirements,
|
||||||
zip_safe=False,
|
zip_safe=False,
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
package_data={"": ["*.md", "*.txt", "data/licenses.json"]},
|
package_data={
|
||||||
|
"": ["*.md", "*.txt", "onefuzz/data/licenses.json", "onefuzz/data/privacy.txt"]
|
||||||
|
},
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user