From 9b4f218e77adec2322566697e02092f514c32dee Mon Sep 17 00:00:00 2001 From: yoshino-s Date: Tue, 11 Mar 2025 19:01:30 +0800 Subject: [PATCH] update --- .gitignore | 177 +++ .python-version | 1 + .vscode/settings.json | 7 + Dockerfile | 20 + README.md | 0 activate/Makefile | 2 + activate/certs/cert_0.pem | 18 + activate/certs/cert_1.pem | 18 + activate/certs/cert_2.pem | 18 + activate/certs/cert_3.pem | 18 + activate/certs/certs.go | 28 + activate/certs/embed.go | 14 + activate/certs/key_0.pem | 28 + activate/certs/key_1.pem | 27 + activate/cmd/client/main.go | 53 + activate/cmd/server/main.go | 109 ++ activate/go.mod | 20 + activate/go.sum | 53 + activate/protos/proto_server.proto | 77 + .../proto/v1/server/proto_server.pb.go | 1397 +++++++++++++++++ .../proto/v1/server/proto_server_grpc.pb.go | 154 ++ extract/descpb_to_proto.py | 241 +++ extract/grpc.py | 74 + extract/proto/fvm.proto | 63 + .../proto/mgt/server/proto/sync/sync.proto | 76 + extract/proto/proto/bridge.proto | 30 + extract/proto/proto/server.proto | 110 ++ pyproject.toml | 12 + replace.py | 16 + uv.lock | 31 + 30 files changed, 2892 insertions(+) create mode 100644 .gitignore create mode 100644 .python-version create mode 100644 .vscode/settings.json create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 activate/Makefile create mode 100644 activate/certs/cert_0.pem create mode 100644 activate/certs/cert_1.pem create mode 100644 activate/certs/cert_2.pem create mode 100644 activate/certs/cert_3.pem create mode 100644 activate/certs/certs.go create mode 100644 activate/certs/embed.go create mode 100644 activate/certs/key_0.pem create mode 100644 activate/certs/key_1.pem create mode 100644 activate/cmd/client/main.go create mode 100644 activate/cmd/server/main.go create mode 100644 activate/go.mod create mode 100644 activate/go.sum create mode 100644 activate/protos/proto_server.proto create mode 100644 activate/safeline/proto/v1/server/proto_server.pb.go create mode 100644 activate/safeline/proto/v1/server/proto_server_grpc.pb.go create mode 100644 extract/descpb_to_proto.py create mode 100644 extract/grpc.py create mode 100644 extract/proto/fvm.proto create mode 100644 extract/proto/mgt/server/proto/sync/sync.proto create mode 100644 extract/proto/proto/bridge.proto create mode 100644 extract/proto/proto/server.proto create mode 100644 pyproject.toml create mode 100644 replace.py create mode 100644 uv.lock diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fe89a3a --- /dev/null +++ b/.gitignore @@ -0,0 +1,177 @@ +# Created by https://www.toptal.com/developers/gitignore/api/python +# Edit at https://www.toptal.com/developers/gitignore?templates=python + +### Python ### +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/#use-with-ide +.pdm.toml + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +#.idea/ + +### Python Patch ### +# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration +poetry.toml + +# ruff +.ruff_cache/ + +# LSP config files +pyrightconfig.json + +# End of https://www.toptal.com/developers/gitignore/api/python + diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..d2c96c0 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.11.3 diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..3aa312b --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "yaml.schemas": { + "https://taskfile.dev/schema.json": "file:///Users/cuichenyang/Workspace/projet/safeline/Taskfile" + }, + "python.analysis.typeCheckingMode": "basic", + "python.analysis.autoImportCompletions": true +} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..888ad48 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM chaitin/safeline-mgt:latest as base + +FROM python:3.10-alpine3.14 as replacer + +RUN cd /tmp &&\ + wget https://github.com/upx/upx/releases/download/v4.2.4/upx-4.2.4-amd64_linux.tar.xz &&\ + tar -xvf upx-4.2.4-amd64_linux.tar.xz &&\ + mv upx-4.2.4-amd64_linux/upx /usr/bin/ &&\ + rm -rf upx-4.2.4-amd64_linux.tar.xz upx-4.2.4-amd64_linux + +COPY --from=base /app/mgt /mgt + +COPY replace.py / + +RUN upx -d /mgt &&\ + python /replace.py /mgt + +FROM base + +COPY --from=replacer /mgt /app/mgt diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/activate/Makefile b/activate/Makefile new file mode 100644 index 0000000..5be3e75 --- /dev/null +++ b/activate/Makefile @@ -0,0 +1,2 @@ +pb: + protoc --go_out=. --go_opt=paths=import --go-grpc_out=. --go-grpc_opt=paths=import -I./protos ./protos/* \ No newline at end of file diff --git a/activate/certs/cert_0.pem b/activate/certs/cert_0.pem new file mode 100644 index 0000000..963d830 --- /dev/null +++ b/activate/certs/cert_0.pem @@ -0,0 +1,18 @@ +-----BEGIN CERTIFICATE----- +MIIC4TCCAcmgAwIBAgIBATANBgkqhkiG9w0BAQsFADAZMRcwFQYDVQQDDA5zYWZl +b3BzX3NlcnZlcjAgFw0yNDAxMTkwODM2MDVaGA8yMTI0MDExOTA4MzYwNVowGTEX +MBUGA1UEAwwOc2FmZW9wc19zZXJ2ZXIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw +ggEKAoIBAQCaqqyHlYCWGlB1vtuknX8d6NhigmQgC9t+y7tp5zMC5VBgVzmji6qn +i5WmIjNq5jUlWecKAqbcP19WqP8z/fwi/QiWmVeHTPDEZPNkwpD9G8J1vjPONmTq +Ut3qFb81CYKKWEhWkEP/Jm7cX+6GDElNBjllp01JKfhnQ2VG6M+fRNvlyhizazUI +eag49NSlnr14A7ejBhfa4JbqRaQrqy9gnVauKKFklebraauQt9Ifoimqsrs0kqnA +TEiUdoahQgjU8VeRRvbGZH02hFCKxTEIoQjOxvHzwGliEUc5nUv+J0m4Heg3tXCh +hBB82fZXZuJBTOrjLHPPis5am6H1cyS1AgMBAAGjMjAwMA8GA1UdEwEB/wQFMAMB +Af8wHQYDVR0OBBYEFHxF5K84izQk5BV+SoVs8Zh+p/PAMA0GCSqGSIb3DQEBCwUA +A4IBAQAZPWz44RRhc80YzW5WeEI3WCJ44D7C90QBUb24v3N7Qr/9TejvuAQFyLCq +bZulGUHKw3SbqxeDkpU2ExKDHqQRX32JtZPWLFt8E9Gnv6Ahjh3KpjitIRR/hr0i +Z4aFijOXe/5Y+eeJOeoc4eqKms6U0qwBmYLMbz/crtvq1QcA/46gqNmnTPO+2hsa +hrP5d86AqPR+l34YIBltQjgivNY0+XmOEXns1ldtCQfUzsrVL4oBRRixLUoz2yWh +kdSWZv1aIfi0Qjv5chXvkmPFKvreSDwQ9vWEpjmWH9Qk3iUJ/q5SunYJrSCD/Wq2 +STbwVsMLE5a2mrvxshlrzHD4mo/W +-----END CERTIFICATE----- \ No newline at end of file diff --git a/activate/certs/cert_1.pem b/activate/certs/cert_1.pem new file mode 100644 index 0000000..b8c15ca --- /dev/null +++ b/activate/certs/cert_1.pem @@ -0,0 +1,18 @@ +-----BEGIN CERTIFICATE----- +MIIC4TCCAcmgAwIBAgIBATANBgkqhkiG9w0BAQsFADAZMRcwFQYDVQQDDA5zYWZl +b3BzX3NlcnZlcjAgFw0yNDAxMjYxMDA0MzhaGA8yMTI0MDEyNjEwMDQzOFowGTEX +MBUGA1UEAwwOc2FmZW9wc19zZXJ2ZXIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw +ggEKAoIBAQCvcDcMN9D0uB2BH5KiGan7qy/g/lnXHalZGFyQMiuttBVuUH1OQzZI +2v+aUBBjBEM9QE/KqMLiSf/ht2fq1nnME5ibN4Bq/+/BZsFYh3zwKya+g9HoiiTh +EOcDI7x1UgK0vNvkYNK0j90CEpooUQr6uJo6cAi5tSk8jKTHXHN69UMlexHHJx3O ++2KVUVd20eD6hijw1nUm7vELtKgVm+OPhgIpJd8JgLMy/+aHSJ5LGn0fgEK1EDSK +QNbq6XgBxyFzjE3nm3kQoW1TQ4bCM7KYlsVX8paXGNtHutk5QSPMzSu8bddN1FiV +9gTS8a2tyH57I0D8irrSY2a0+8uwK6zvAgMBAAGjMjAwMA8GA1UdEwEB/wQFMAMB +Af8wHQYDVR0OBBYEFB87MQdFVXygzHgbAvEO1qPGY+okMA0GCSqGSIb3DQEBCwUA +A4IBAQAZTZE9yDNebpllAOHyJKp8KDnGUX/KFhtD91B2bQ2ETGGcSdVs9EO6enDZ +DObe5m1bH/FNS5TcB4E2bMGWFul7jYIQyIlN92zFMjHEj/X2WaU0QaLFmCAJaQZN +Jqi/iCrn1KWZIH6xfQNMyRE2251uMTFQRDTxasBjWQ0kIIVsDT4tVdYG1X2Ea7kF +FezHTYptGj09EOFkJ+ppZoLlAQopwtsxwt92c9FiBhY5F+xMhj7SHiEPGpxNLIV5 +lX7D4N+HW8XKb9Iob+b+d4q2XRnZuFLuQdxV98pKwxDtriDdS4r0TCVjSMJk1u/w +TvtvK1/QTQycBNzawo11TvLiZTir +-----END CERTIFICATE----- \ No newline at end of file diff --git a/activate/certs/cert_2.pem b/activate/certs/cert_2.pem new file mode 100644 index 0000000..6397988 --- /dev/null +++ b/activate/certs/cert_2.pem @@ -0,0 +1,18 @@ +-----BEGIN CERTIFICATE----- +MIIC6jCCAdKgAwIBAgIBATANBgkqhkiG9w0BAQsFADAZMRcwFQYDVQQDDA5zYWZl +b3BzX3NlcnZlcjAgFw0yNDAxMjYxMDA0MzhaGA8yMTI0MDEyNjEwMDQzOFowGTEX +MBUGA1UEAwwOc2FmZW9wc19zZXJ2ZXIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw +ggEKAoIBAQCz/45yQ35YomeGgO80Cg1S7F6kiNboTClCtrKBale98sKaKCoiV+gG +7vYKOTn/5DhDmawHATe1ENtrkAl3eAjvE0uHpcRnSi2B1Bcwt0r+7YyrxqoMCDiX +Bja8gpzXn4aZiDEYtdD5jVAq7N2wkVnHEdGyqGByh3M0pmUPUBNTTKzv7YGUfQeG +zERKlv0I7B06OS2LwYOLb6Xg70I9CxqPrqwelRGcbrFP4IyrM6C5QrTue1fMy30u +XFIxYS5SWjWys314rzWmJ+z7lmal3cGh+3oc7nhlxVlT9gWgc6V0t2+lVazhmCPQ +vXW64HjEoQvvmPVzkMhvbt8dBQUcV5dbAgMBAAGjOzA5MA4GA1UdDwEB/wQEAwIH +gDAMBgNVHRMBAf8EAjAAMBkGA1UdEQQSMBCCDnNhZmVvcHNfc2VydmVyMA0GCSqG +SIb3DQEBCwUAA4IBAQBPbR7pJjADGMHhZi//gylpbGF7XmZL58OC5Qba2IuO5JWF +Be8gO1A+PUsMHavUEkd2LGxZUWLc0j2fCtSq4Ui7Hck6tbpHwnnny83pr6jjpqZ1 +PIeicmukRrIuSVHvw9gDI3HvBmHDlMbjOn5/ZrCGJv5flv+rvaRdIOXe4fQfPWg4 +oD4OM2C3yycln8QWAdAOxsrdsTeyEnJFlMRk/98y5KHCrlg8q9jVNq/jkl1a+0xF +Dh+RyGl+v+830AeQWj2uWF+svTlWD33oF5srkeWK24JYmbKRwT/6+RrXjfrDDcWg +VfQr+GwlipY7dAqT8pYWCmmL8GCRui+FeBTUezlF +-----END CERTIFICATE----- \ No newline at end of file diff --git a/activate/certs/cert_3.pem b/activate/certs/cert_3.pem new file mode 100644 index 0000000..1a50678 --- /dev/null +++ b/activate/certs/cert_3.pem @@ -0,0 +1,18 @@ +-----BEGIN CERTIFICATE----- +MIIC9jCCAd4CFGOjD+kDjDesBb0h+iV806oSwI72MA0GCSqGSIb3DQEBCwUAMBkx +FzAVBgNVBAMMDnNhZmVvcHNfc2VydmVyMB4XDTI0MDEyNjA4MDczMVoXDTI1MDEy +NTA4MDczMVowVjELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAf +BgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEPMA0GA1UEAwwGMTIzNDU2 +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxAe4pElf6eM0XLE5/VEo +o4GDz5w0up6a04iZm0wddGQYOuhFRewWxOoA/5npuZLE9APgWZM0aBseptyrwhsf +gnbl861Fb2Fs4FkhRsjJT7dgDhZ5UkwnaeHuhaaakQz+OvufwStHjeJnZ5p7KU4U +LFa2BCAXAgIusOZX6FY//RfVo9fEyduubR1OGOiScx8z3ZyNoPx6WvM0T1H18cOi +fb9ORHTV3arADT3FaOJB/lLcuMLedPu191mYDaHjlhQs8ub4l01OgP2a21hidYBc +GcfP18Q1zyBozCDxt6OGvHN/2ohmut4aU+c4AULEqjIs4y3D/9FfhjhzXDq04ZP7 +AQIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQAnZDveQKjiL7UUMrSxvKcrkrcCgKxt +3HbnwSIyu+8fON3pyN2+YC/brFjbat+Ykvb+jxPxtoZg5cy+olR1RvUrQUmN62j9 +5tEFr4xHJYP75dSyrYyfQ1flUJJlgzZN9SRIqQfnYySn+mLkzrAIpPNWywNpqPi5 +zQ1GuXSDBLPLnTrTO8eK+XpXbOIGW4lHfnOfqBXOcVh1Alxh78YTg0BzmyUUtg/j +nf3pxZOWq6UgLNfOPCalbTacX5PguVtMaloA1A0CiU9tGPd9EOH3FkEKV4QE2nMW +2DsCkgczQOyaxaUy7iJk+wmbLMlwTREalMkndNuaX4h/e5MAOnR6Ev63 +-----END CERTIFICATE----- \ No newline at end of file diff --git a/activate/certs/certs.go b/activate/certs/certs.go new file mode 100644 index 0000000..77aece3 --- /dev/null +++ b/activate/certs/certs.go @@ -0,0 +1,28 @@ +package certs + +import ( + "crypto/tls" + "crypto/x509" + "fmt" + + "google.golang.org/grpc/credentials" +) + +func LoadTransportCredentials() (credentials.TransportCredentials, error) { + cert, err := tls.X509KeyPair(Cert_2, Key_1) + if err != nil { + return nil, err + } + + certPool := x509.NewCertPool() + if ok := certPool.AppendCertsFromPEM(Cert_1); !ok { + return nil, fmt.Errorf("failed to append ca certs") + } + + return credentials.NewTLS(&tls.Config{ + ServerName: "safeops_server", + Certificates: []tls.Certificate{cert}, + RootCAs: certPool, + ClientAuth: tls.NoClientCert, + }), nil +} diff --git a/activate/certs/embed.go b/activate/certs/embed.go new file mode 100644 index 0000000..c865b17 --- /dev/null +++ b/activate/certs/embed.go @@ -0,0 +1,14 @@ +package certs + +import ( + _ "embed" +) + +//go:embed cert_2.pem +var Cert_2 []byte + +//go:embed key_1.pem +var Key_1 []byte + +//go:embed cert_1.pem +var Cert_1 []byte diff --git a/activate/certs/key_0.pem b/activate/certs/key_0.pem new file mode 100644 index 0000000..4fd939a --- /dev/null +++ b/activate/certs/key_0.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDEB7ikSV/p4zRc +sTn9USijgYPPnDS6nprTiJmbTB10ZBg66EVF7BbE6gD/mem5ksT0A+BZkzRoGx6m +3KvCGx+CduXzrUVvYWzgWSFGyMlPt2AOFnlSTCdp4e6FppqRDP46+5/BK0eN4mdn +mnspThQsVrYEIBcCAi6w5lfoVj/9F9Wj18TJ265tHU4Y6JJzHzPdnI2g/Hpa8zRP +UfXxw6J9v05EdNXdqsANPcVo4kH+Uty4wt50+7X3WZgNoeOWFCzy5viXTU6A/Zrb +WGJ1gFwZx8/XxDXPIGjMIPG3o4a8c3/aiGa63hpT5zgBQsSqMizjLcP/0V+GOHNc +OrThk/sBAgMBAAECggEAAPaQv63knL+TCEmOoWH+sx71yNVZpPkWhaeMKaksE+BS +BigR/w/z5K/JpXfaICFKenByb747aa+IbQV0ipWbiAaRhqr5RlzSLiAB+9kMtCmQ +fUE7A16AaxLDG0EATWok7aFC3a4aweW04Ftv83oAu18Jsed+dXIRTKk1EV0rH1E2 +c0sKwpPIOC7N4xIXqiZ7KQ7JFCrlwIv2LFV/XFFFhTGqF5UHNsr4EemzNDAHFoz8 +lgfhOC4JyF3ErtumSkXrWE11F911WjltUSpNV7Au4Stqco8tSrRVMInyQLaXsJSd +0RkAzznoQD6PVrYOEA9ktkVfYg98fjRf/EZ3JINNiQKBgQD26RnSlDjMfiGXq7Z5 +b92ublB6H35vfxOJQ3kzf/4v+TcgkCmAgbUphpuNw2vPBdRFDl56PxtT3wEKo0FD +NbOIMcYqe/h9q1DxjUx/XiNhU7lFm04SV6vr1EyfBBdFx4KIqq58UPyb8G6wITuJ +vBP4gTjrJW6JU0NFjeO3pPOC9wKBgQDLPx7lyqvKHEf65g6IH8LdQTp6Gig+LsjV +vjILvABom3DlKRF1TYDT1lHTj9ARhFxMH6+4b7V7NuoA/f0hO6O61sBKq5ahYpH+ +soXrDJwhcyOD5U6BX+cOj5KASe6EZZebMMoWwMOyvXWunbpKvUIphN7ce+GaBb73 +OhsHluf7xwKBgQD2p4QpTfKzrejm+B2QkITW5NK2PNH0lfCxNdtU7C7EQ+SjPgCH +pIuSkSrB4o/HPt5/ocwVuQcWsPb8ZnwipPnVO0voUvG4sLRqqanarvMPHjE97NiA +EF7pdqqYS+Dnz1eCKWenPswrB3O7tWchv+X/YS+4ECutOaVBTW5HnZu5nwKBgE26 +Au/wNQhjDmf2KSKHuvbwZhOiAzfcnnOXe/4e1K0snN0WepW4oQbiVIKq4fCBBOcb +yxCmr+nCE3VzrKVT8IaYcAteWYm4b4rO7QX52Y+1P6TGQeKaMXvRDj6/h1bcn0D7 +RJ209GJbsDCqIz9H55CHPs9lFN7ZSbG0Z/fcDzWrAoGBAIJ3LRwHzxtf6URVBiTO +LX6KYDQ3sxLJxIvQnGzpnf5Tz3Hwz56CwcL+N/2vASNWUfNJRGk84rMpLYqHobIc +A7W9QZif5v7cVrWEqhgzuYj5U020+3/gTjqLTSpd92DfcxK391LuIYSxe3UFci01 +mWOU/+psAlH/KAU7sATS0nJw +-----END PRIVATE KEY----- \ No newline at end of file diff --git a/activate/certs/key_1.pem b/activate/certs/key_1.pem new file mode 100644 index 0000000..e28da84 --- /dev/null +++ b/activate/certs/key_1.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEowIBAAKCAQEAs/+OckN+WKJnhoDvNAoNUuxepIjW6EwpQraygWpXvfLCmigq +IlfoBu72Cjk5/+Q4Q5msBwE3tRDba5AJd3gI7xNLh6XEZ0otgdQXMLdK/u2Mq8aq +DAg4lwY2vIKc15+GmYgxGLXQ+Y1QKuzdsJFZxxHRsqhgcodzNKZlD1ATU0ys7+2B +lH0HhsxESpb9COwdOjkti8GDi2+l4O9CPQsaj66sHpURnG6xT+CMqzOguUK07ntX +zMt9LlxSMWEuUlo1srN9eK81pifs+5Zmpd3Boft6HO54ZcVZU/YFoHOldLdvpVWs +4Zgj0L11uuB4xKEL75j1c5DIb27fHQUFHFeXWwIDAQABAoIBAHpXOHpxZW7Y84R4 +Hh1At82k2q76UxeQrHqrsqhDn197oMkmg3zUQuBzisdoHgPPGm7YBBS+vx5SVtDF +Faod6/STKMMJ6HRL9qJHhXuXGWIsE3CtluaWr9/2WT3HiNMFmnbAGp6w9Vios9R5 +KjTYliy3789+og82ARfIAOhnhLsYPk3ZaoM8NCJLC9w79pde1sN3+hy2DsaSxU2t +lqP4BB+YDjAvzXCwVIuJzlM94Rjmc7SpHqSl62V4y0QKFzb31dwTaS8ZPznDCT+J +TTa6P23Rq9UyYThJ4mqyiR1v5WoixBETVJ0YCQyEeYN8Cl9trgRs7ehuVJP/n/np +2VjV0AECgYEA4ULUNKkP5I8awO2ZWECPpPD6/nX/BKcCgBkgB+xAlSj84Gl2ebkh +UEHsFx9aVqh+vjYg1rnKcvT4WtWHj6+Zg/L7+A7duQVL5wPO3R6Hv9AtN//UBmYw +CYL0omnK33i2Xm0KNoHP2qyc8NdeFG+4s6nmFCnDpu6t+FTCguKqas8CgYEAzI+J +hzzb5hpF2HiIM8CDj6EQ9NnljlwkQHHQ26+aeX7O9TktUdDsnQhDZBeMe5b5l6ry +TSIO7LvB2NknEn3ida4xPPBszorHCl3s+y8EaJPqEJpa3kJHLmkpLoYl0IBe9nBv +qNq+gNbO1EqO0WpJXvkJw19XFD+IsdqYGWHdfbUCgYAeEJhYCvR3Ee6FL3EXCU7i +udMWIVOPIGdCB5hx1kNsZRMTNKA+cMoUdyf2khWxmT2JT5okbpmprC51mShFsi8w +ID8nBXzsU9ukkqqKcqe1nyhZ4AhBbmQc8OCLyMjt+KOGiNEjI0JFsmIj9uq0mZCy +UgvGRyi44ARSL6XiaDRMmwKBgQCuljssnzaW9wlxrb2hXcdrSG5ua6JOlDmkfv9g +4EkZNK9x//C8CXJIvAq4XJjbyokPdykBx/Ww+raBWyTL1YD4K0l+1zwmM6+ZG3zt +DL3Ye5WjwfmYBD04USyCtp+DimyCLIhANyGsWKmB6nhmJy6jzi0VAEQT1f3Wvdhe +oXYmmQKBgHtq5nNOtCVQ4XsDUXYbs3lo2LnU/9ENZ6jSDlE878qFnBvEdaZYT/LB +Q9OOKOvJlHiaihRTb+aIR9QuikVgU7dsr33Yak4LDpOFgQpyi+y0ZImuo/3rR1xk +9earvT3iWLqjaMNQuV9IOHDtyYLTYSLE8M1Ag1noOE5O1Zh4NuUe +-----END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/activate/cmd/client/main.go b/activate/cmd/client/main.go new file mode 100644 index 0000000..e02e795 --- /dev/null +++ b/activate/cmd/client/main.go @@ -0,0 +1,53 @@ +package main + +import ( + "context" + "log" + "safeline/certs" + "safeline/safeline/proto/v1/server" + + "google.golang.org/grpc" +) + +var ( + endpoint = "localhost:50052" +) + +func main() { + creds, err := certs.LoadTransportCredentials() + if err != nil { + panic(err) + } + + conn, err := grpc.Dial(endpoint, grpc.WithTransportCredentials(creds)) + if err != nil { + panic(err) + } + defer conn.Close() + client := server.NewServerClient(conn) + + c, err := client.Sync(context.TODO()) + if err != nil { + panic(err) + } + + req := &server.SyncRequest{} + req.Message = &server.SyncRequest_ValidateCode{ + ValidateCode: &server.ValidateCode{ + Code: "123", + MachineId: "456", + Version: "789", + }, + } + + if err := c.Send(req); err != nil { + panic(err) + } + + resp, err := c.Recv() + if err != nil { + panic(err) + } + + log.Printf("resp: %+v", resp) +} diff --git a/activate/cmd/server/main.go b/activate/cmd/server/main.go new file mode 100644 index 0000000..f839c21 --- /dev/null +++ b/activate/cmd/server/main.go @@ -0,0 +1,109 @@ +package main + +import ( + "net" + "net/http" + "safeline/certs" + "safeline/safeline/proto/v1/server" + "time" + + "go.uber.org/zap" + "google.golang.org/grpc" +) + +type ServerImpl struct { + server.UnimplementedServerServer +} + +func (s *ServerImpl) Sync(conn server.Server_SyncServer) error { + for { + req, err := conn.Recv() + if err != nil { + return err + } + zap.L().Info("recv", zap.Any("req", req)) + + res := &server.SyncPush{} + + switch req.Message.(type) { + case *server.SyncRequest_Ping: + res.Message = &server.SyncPush_Pong{} + case *server.SyncRequest_ValidateCode: + res.Message = &server.SyncPush_ValidateResult{ + ValidateResult: &server.ValidateResult{ + State: server.ValidateCodeState_VALIDATE_CODE_STATE_SUCCESS, + ExpiredAt: time.Now().Add(time.Hour * 24 * 365 * 16).Unix(), + OrgName: "114514 Inc.", + OrgId: "114514", + Id: "114514", + Edition: server.Edition_EDITION_ENTERPRISE, + }, + } + case *server.SyncRequest_ChangeCode: + res.Message = &server.SyncPush_ChangeCodeResult{ + ChangeCodeResult: &server.ChangeCodeResult{ + State: server.ValidateCodeState_VALIDATE_CODE_STATE_SUCCESS, + ExpiredAt: time.Now().Add(time.Hour * 24 * 365 * 16).Unix(), + OrgName: "114514 Inc.", + OrgId: "114514", + Id: "114514", + Edition: server.Edition_EDITION_ENTERPRISE, + }, + } + case *server.SyncRequest_GivebackCode: + res.Message = &server.SyncPush_GivebackCodeResult{ + GivebackCodeResult: &server.GiveBackCodeResult{ + State: server.GiveBackCodeState_GIVEBACK_CODE_STATE_FAILED, + }, + } + } + zap.L().Info("send", zap.Any("res", res)) + + if err := conn.Send(res); err != nil { + return err + } + } +} + +func httpServer() *http.Server { + serveMux := http.NewServeMux() + // record all + serveMux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + zap.L().Info( + "http", + zap.String("url", r.URL.String()), + zap.String("method", r.Method), + zap.Any("header", r.Header), + zap.Any("query", r.URL.Query()), + ) + }) + + return &http.Server{ + Addr: ":50052", + Handler: serveMux, + } +} + +func main() { + logger, _ := zap.NewDevelopment() + zap.ReplaceGlobals(logger) + + tlsCredentials, err := certs.LoadTransportCredentials() + if err != nil { + panic(err) + } + + grpcServer := grpc.NewServer( + grpc.Creds(tlsCredentials), + ) + + server.RegisterServerServer(grpcServer, &ServerImpl{}) + + l, err := net.Listen("tcp", ":50052") + if err != nil { + panic(err) + } + + zap.L().Info("server started") + grpcServer.Serve(l) +} diff --git a/activate/go.mod b/activate/go.mod new file mode 100644 index 0000000..45245b0 --- /dev/null +++ b/activate/go.mod @@ -0,0 +1,20 @@ +module safeline + +go 1.22 + +toolchain go1.23.4 + +require ( + go.uber.org/zap v1.27.0 + google.golang.org/grpc v1.69.4 + google.golang.org/protobuf v1.36.2 +) + +require ( + github.com/golang/protobuf v1.5.4 // indirect + go.uber.org/multierr v1.11.0 // indirect + golang.org/x/net v0.34.0 // indirect + golang.org/x/sys v0.29.0 // indirect + golang.org/x/text v0.21.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250106144421-5f5ef82da422 // indirect +) diff --git a/activate/go.sum b/activate/go.sum new file mode 100644 index 0000000..4838eec --- /dev/null +++ b/activate/go.sum @@ -0,0 +1,53 @@ +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= +go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo= +go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= +go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= +go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe h1:bQnxqljG/wqi4NTXu2+DJ3n7APcEA882QZ1JvhQAq9o= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250106144421-5f5ef82da422 h1:3UsHvIr4Wc2aW4brOaSCmcxh9ksica6fHEr8P1XhkYw= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250106144421-5f5ef82da422/go.mod h1:3ENsm/5D1mzDyhpzeRi1NR784I0BcofWBoSc5QqqMK4= +google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0= +google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= +google.golang.org/grpc v1.69.4 h1:MF5TftSMkd8GLw/m0KM6V8CMOCY6NZ1NQDPGFgbTt4A= +google.golang.org/grpc v1.69.4/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.36.2 h1:R8FeyR1/eLmkutZOM5CWghmo5itiG9z0ktFlTVLuTmU= +google.golang.org/protobuf v1.36.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/activate/protos/proto_server.proto b/activate/protos/proto_server.proto new file mode 100644 index 0000000..78d1b53 --- /dev/null +++ b/activate/protos/proto_server.proto @@ -0,0 +1,77 @@ +syntax = "proto3"; + +package chaitin.safeline_ops.proto.v1.server; +option go_package = "safeline/proto/v1/server"; + +import "google/protobuf/empty.proto"; + +service Server { + rpc Sync(stream SyncRequest) returns (stream SyncPush); +} + +message ValidateCode { + string code = 1; + string machine_id = 2; + string version = 3; +} + +message ChangeCode { + string new_code = 1; + string machine_id = 2; + string version = 3; +} + +message GiveBackCode { + string code = 1; + string machine_id = 2; + string version = 3; +} + +message ValidateResult { + ValidateCodeState state = 1; + int64 expired_at = 2; + string org_name = 3; + string org_id = 4; +} + +message ChangeCodeResult { + ValidateCodeState state = 1; + int64 expired_at = 2; + string org_name = 3; + string org_id = 4; +} + +message GiveBackCodeResult { + GiveBackCodeState state = 1; +} + +message SyncRequest { + oneof message { + google.protobuf.Empty ping = 1; + ValidateCode validate_code = 2; + ChangeCode change_code = 3; + GiveBackCode giveback_code = 4; + } +} + +message SyncPush { + oneof message { + google.protobuf.Empty pong = 1; + ValidateResult validate_result = 2; + ChangeCodeResult change_code_result = 3; + GiveBackCodeResult giveback_code_result = 4; + } +} + +enum ValidateCodeState { + VALIDATE_CODE_STATE_SUCCESS = 0; + VALIDATE_CODE_STATE_EXPIRED = 1; + VALIDATE_CODE_STATE_INVALID = 2; + VALIDATE_CODE_STATE_USED = 3; + VALIDATE_CODE_STATE_CONNECTED = 4; +} + +enum GiveBackCodeState { + GIVEBACK_CODE_STATE_SUCCESS = 0; + GIVEBACK_CODE_STATE_FAILED = 1; +} diff --git a/activate/safeline/proto/v1/server/proto_server.pb.go b/activate/safeline/proto/v1/server/proto_server.pb.go new file mode 100644 index 0000000..cf35902 --- /dev/null +++ b/activate/safeline/proto/v1/server/proto_server.pb.go @@ -0,0 +1,1397 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc v5.29.1 +// source: proto_server.proto + +package server + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ValidateCodeState int32 + +const ( + ValidateCodeState_VALIDATE_CODE_STATE_SUCCESS ValidateCodeState = 0 + ValidateCodeState_VALIDATE_CODE_STATE_EXPIRED ValidateCodeState = 1 + ValidateCodeState_VALIDATE_CODE_STATE_INVALID ValidateCodeState = 2 + ValidateCodeState_VALIDATE_CODE_STATE_USED ValidateCodeState = 3 + ValidateCodeState_VALIDATE_CODE_STATE_CONNECTED ValidateCodeState = 4 +) + +// Enum value maps for ValidateCodeState. +var ( + ValidateCodeState_name = map[int32]string{ + 0: "VALIDATE_CODE_STATE_SUCCESS", + 1: "VALIDATE_CODE_STATE_EXPIRED", + 2: "VALIDATE_CODE_STATE_INVALID", + 3: "VALIDATE_CODE_STATE_USED", + 4: "VALIDATE_CODE_STATE_CONNECTED", + } + ValidateCodeState_value = map[string]int32{ + "VALIDATE_CODE_STATE_SUCCESS": 0, + "VALIDATE_CODE_STATE_EXPIRED": 1, + "VALIDATE_CODE_STATE_INVALID": 2, + "VALIDATE_CODE_STATE_USED": 3, + "VALIDATE_CODE_STATE_CONNECTED": 4, + } +) + +func (x ValidateCodeState) Enum() *ValidateCodeState { + p := new(ValidateCodeState) + *p = x + return p +} + +func (x ValidateCodeState) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ValidateCodeState) Descriptor() protoreflect.EnumDescriptor { + return file_proto_server_proto_enumTypes[0].Descriptor() +} + +func (ValidateCodeState) Type() protoreflect.EnumType { + return &file_proto_server_proto_enumTypes[0] +} + +func (x ValidateCodeState) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ValidateCodeState.Descriptor instead. +func (ValidateCodeState) EnumDescriptor() ([]byte, []int) { + return file_proto_server_proto_rawDescGZIP(), []int{0} +} + +type Edition int32 + +const ( + Edition_EDITION_UNKOWN Edition = 0 + Edition_EDITION_PROFESSIONAL Edition = 1 + Edition_EDITION_ENTERPRISE Edition = 2 +) + +// Enum value maps for Edition. +var ( + Edition_name = map[int32]string{ + 0: "EDITION_UNKOWN", + 1: "EDITION_PROFESSIONAL", + 2: "EDITION_ENTERPRISE", + } + Edition_value = map[string]int32{ + "EDITION_UNKOWN": 0, + "EDITION_PROFESSIONAL": 1, + "EDITION_ENTERPRISE": 2, + } +) + +func (x Edition) Enum() *Edition { + p := new(Edition) + *p = x + return p +} + +func (x Edition) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Edition) Descriptor() protoreflect.EnumDescriptor { + return file_proto_server_proto_enumTypes[1].Descriptor() +} + +func (Edition) Type() protoreflect.EnumType { + return &file_proto_server_proto_enumTypes[1] +} + +func (x Edition) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Edition.Descriptor instead. +func (Edition) EnumDescriptor() ([]byte, []int) { + return file_proto_server_proto_rawDescGZIP(), []int{1} +} + +type GiveBackCodeState int32 + +const ( + GiveBackCodeState_GIVEBACK_CODE_STATE_SUCCESS GiveBackCodeState = 0 + GiveBackCodeState_GIVEBACK_CODE_STATE_FAILED GiveBackCodeState = 1 +) + +// Enum value maps for GiveBackCodeState. +var ( + GiveBackCodeState_name = map[int32]string{ + 0: "GIVEBACK_CODE_STATE_SUCCESS", + 1: "GIVEBACK_CODE_STATE_FAILED", + } + GiveBackCodeState_value = map[string]int32{ + "GIVEBACK_CODE_STATE_SUCCESS": 0, + "GIVEBACK_CODE_STATE_FAILED": 1, + } +) + +func (x GiveBackCodeState) Enum() *GiveBackCodeState { + p := new(GiveBackCodeState) + *p = x + return p +} + +func (x GiveBackCodeState) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (GiveBackCodeState) Descriptor() protoreflect.EnumDescriptor { + return file_proto_server_proto_enumTypes[2].Descriptor() +} + +func (GiveBackCodeState) Type() protoreflect.EnumType { + return &file_proto_server_proto_enumTypes[2] +} + +func (x GiveBackCodeState) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use GiveBackCodeState.Descriptor instead. +func (GiveBackCodeState) EnumDescriptor() ([]byte, []int) { + return file_proto_server_proto_rawDescGZIP(), []int{2} +} + +type ValidateCode struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` + MachineId string `protobuf:"bytes,2,opt,name=machine_id,json=machineId,proto3" json:"machine_id,omitempty"` + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` + Id string `protobuf:"bytes,4,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *ValidateCode) Reset() { + *x = ValidateCode{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_server_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidateCode) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateCode) ProtoMessage() {} + +func (x *ValidateCode) ProtoReflect() protoreflect.Message { + mi := &file_proto_server_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateCode.ProtoReflect.Descriptor instead. +func (*ValidateCode) Descriptor() ([]byte, []int) { + return file_proto_server_proto_rawDescGZIP(), []int{0} +} + +func (x *ValidateCode) GetCode() string { + if x != nil { + return x.Code + } + return "" +} + +func (x *ValidateCode) GetMachineId() string { + if x != nil { + return x.MachineId + } + return "" +} + +func (x *ValidateCode) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *ValidateCode) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type ChangeCode struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NewCode string `protobuf:"bytes,1,opt,name=new_code,json=newCode,proto3" json:"new_code,omitempty"` + MachineId string `protobuf:"bytes,2,opt,name=machine_id,json=machineId,proto3" json:"machine_id,omitempty"` + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` + Id string `protobuf:"bytes,4,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *ChangeCode) Reset() { + *x = ChangeCode{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_server_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChangeCode) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChangeCode) ProtoMessage() {} + +func (x *ChangeCode) ProtoReflect() protoreflect.Message { + mi := &file_proto_server_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChangeCode.ProtoReflect.Descriptor instead. +func (*ChangeCode) Descriptor() ([]byte, []int) { + return file_proto_server_proto_rawDescGZIP(), []int{1} +} + +func (x *ChangeCode) GetNewCode() string { + if x != nil { + return x.NewCode + } + return "" +} + +func (x *ChangeCode) GetMachineId() string { + if x != nil { + return x.MachineId + } + return "" +} + +func (x *ChangeCode) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *ChangeCode) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type GiveBackCode struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` + MachineId string `protobuf:"bytes,2,opt,name=machine_id,json=machineId,proto3" json:"machine_id,omitempty"` + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` + Id string `protobuf:"bytes,4,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *GiveBackCode) Reset() { + *x = GiveBackCode{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_server_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GiveBackCode) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GiveBackCode) ProtoMessage() {} + +func (x *GiveBackCode) ProtoReflect() protoreflect.Message { + mi := &file_proto_server_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GiveBackCode.ProtoReflect.Descriptor instead. +func (*GiveBackCode) Descriptor() ([]byte, []int) { + return file_proto_server_proto_rawDescGZIP(), []int{2} +} + +func (x *GiveBackCode) GetCode() string { + if x != nil { + return x.Code + } + return "" +} + +func (x *GiveBackCode) GetMachineId() string { + if x != nil { + return x.MachineId + } + return "" +} + +func (x *GiveBackCode) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *GiveBackCode) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type ValidateResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + State ValidateCodeState `protobuf:"varint,1,opt,name=state,proto3,enum=chaitin.safeline_ops.proto.v1.server.ValidateCodeState" json:"state,omitempty"` + ExpiredAt int64 `protobuf:"varint,2,opt,name=expired_at,json=expiredAt,proto3" json:"expired_at,omitempty"` + OrgName string `protobuf:"bytes,3,opt,name=org_name,json=orgName,proto3" json:"org_name,omitempty"` + OrgId string `protobuf:"bytes,4,opt,name=org_id,json=orgId,proto3" json:"org_id,omitempty"` + Id string `protobuf:"bytes,5,opt,name=id,proto3" json:"id,omitempty"` + Edition Edition `protobuf:"varint,6,opt,name=edition,proto3,enum=chaitin.safeline_ops.proto.v1.server.Edition" json:"edition,omitempty"` +} + +func (x *ValidateResult) Reset() { + *x = ValidateResult{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_server_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidateResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateResult) ProtoMessage() {} + +func (x *ValidateResult) ProtoReflect() protoreflect.Message { + mi := &file_proto_server_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateResult.ProtoReflect.Descriptor instead. +func (*ValidateResult) Descriptor() ([]byte, []int) { + return file_proto_server_proto_rawDescGZIP(), []int{3} +} + +func (x *ValidateResult) GetState() ValidateCodeState { + if x != nil { + return x.State + } + return ValidateCodeState_VALIDATE_CODE_STATE_SUCCESS +} + +func (x *ValidateResult) GetExpiredAt() int64 { + if x != nil { + return x.ExpiredAt + } + return 0 +} + +func (x *ValidateResult) GetOrgName() string { + if x != nil { + return x.OrgName + } + return "" +} + +func (x *ValidateResult) GetOrgId() string { + if x != nil { + return x.OrgId + } + return "" +} + +func (x *ValidateResult) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *ValidateResult) GetEdition() Edition { + if x != nil { + return x.Edition + } + return Edition_EDITION_UNKOWN +} + +type ChangeCodeResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + State ValidateCodeState `protobuf:"varint,1,opt,name=state,proto3,enum=chaitin.safeline_ops.proto.v1.server.ValidateCodeState" json:"state,omitempty"` + ExpiredAt int64 `protobuf:"varint,2,opt,name=expired_at,json=expiredAt,proto3" json:"expired_at,omitempty"` + OrgName string `protobuf:"bytes,3,opt,name=org_name,json=orgName,proto3" json:"org_name,omitempty"` + OrgId string `protobuf:"bytes,4,opt,name=org_id,json=orgId,proto3" json:"org_id,omitempty"` + Id string `protobuf:"bytes,5,opt,name=id,proto3" json:"id,omitempty"` + Edition Edition `protobuf:"varint,6,opt,name=edition,proto3,enum=chaitin.safeline_ops.proto.v1.server.Edition" json:"edition,omitempty"` +} + +func (x *ChangeCodeResult) Reset() { + *x = ChangeCodeResult{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_server_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChangeCodeResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChangeCodeResult) ProtoMessage() {} + +func (x *ChangeCodeResult) ProtoReflect() protoreflect.Message { + mi := &file_proto_server_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChangeCodeResult.ProtoReflect.Descriptor instead. +func (*ChangeCodeResult) Descriptor() ([]byte, []int) { + return file_proto_server_proto_rawDescGZIP(), []int{4} +} + +func (x *ChangeCodeResult) GetState() ValidateCodeState { + if x != nil { + return x.State + } + return ValidateCodeState_VALIDATE_CODE_STATE_SUCCESS +} + +func (x *ChangeCodeResult) GetExpiredAt() int64 { + if x != nil { + return x.ExpiredAt + } + return 0 +} + +func (x *ChangeCodeResult) GetOrgName() string { + if x != nil { + return x.OrgName + } + return "" +} + +func (x *ChangeCodeResult) GetOrgId() string { + if x != nil { + return x.OrgId + } + return "" +} + +func (x *ChangeCodeResult) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *ChangeCodeResult) GetEdition() Edition { + if x != nil { + return x.Edition + } + return Edition_EDITION_UNKOWN +} + +type GiveBackCodeResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + State GiveBackCodeState `protobuf:"varint,1,opt,name=state,proto3,enum=chaitin.safeline_ops.proto.v1.server.GiveBackCodeState" json:"state,omitempty"` + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *GiveBackCodeResult) Reset() { + *x = GiveBackCodeResult{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_server_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GiveBackCodeResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GiveBackCodeResult) ProtoMessage() {} + +func (x *GiveBackCodeResult) ProtoReflect() protoreflect.Message { + mi := &file_proto_server_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GiveBackCodeResult.ProtoReflect.Descriptor instead. +func (*GiveBackCodeResult) Descriptor() ([]byte, []int) { + return file_proto_server_proto_rawDescGZIP(), []int{5} +} + +func (x *GiveBackCodeResult) GetState() GiveBackCodeState { + if x != nil { + return x.State + } + return GiveBackCodeState_GIVEBACK_CODE_STATE_SUCCESS +} + +func (x *GiveBackCodeResult) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type SyncRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Message: + // + // *SyncRequest_Ping + // *SyncRequest_ValidateCode + // *SyncRequest_ChangeCode + // *SyncRequest_GivebackCode + Message isSyncRequest_Message `protobuf_oneof:"message"` +} + +func (x *SyncRequest) Reset() { + *x = SyncRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_server_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SyncRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncRequest) ProtoMessage() {} + +func (x *SyncRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_server_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SyncRequest.ProtoReflect.Descriptor instead. +func (*SyncRequest) Descriptor() ([]byte, []int) { + return file_proto_server_proto_rawDescGZIP(), []int{6} +} + +func (m *SyncRequest) GetMessage() isSyncRequest_Message { + if m != nil { + return m.Message + } + return nil +} + +func (x *SyncRequest) GetPing() *emptypb.Empty { + if x, ok := x.GetMessage().(*SyncRequest_Ping); ok { + return x.Ping + } + return nil +} + +func (x *SyncRequest) GetValidateCode() *ValidateCode { + if x, ok := x.GetMessage().(*SyncRequest_ValidateCode); ok { + return x.ValidateCode + } + return nil +} + +func (x *SyncRequest) GetChangeCode() *ChangeCode { + if x, ok := x.GetMessage().(*SyncRequest_ChangeCode); ok { + return x.ChangeCode + } + return nil +} + +func (x *SyncRequest) GetGivebackCode() *GiveBackCode { + if x, ok := x.GetMessage().(*SyncRequest_GivebackCode); ok { + return x.GivebackCode + } + return nil +} + +type isSyncRequest_Message interface { + isSyncRequest_Message() +} + +type SyncRequest_Ping struct { + Ping *emptypb.Empty `protobuf:"bytes,1,opt,name=ping,proto3,oneof"` +} + +type SyncRequest_ValidateCode struct { + ValidateCode *ValidateCode `protobuf:"bytes,2,opt,name=validate_code,json=validateCode,proto3,oneof"` +} + +type SyncRequest_ChangeCode struct { + ChangeCode *ChangeCode `protobuf:"bytes,3,opt,name=change_code,json=changeCode,proto3,oneof"` +} + +type SyncRequest_GivebackCode struct { + GivebackCode *GiveBackCode `protobuf:"bytes,4,opt,name=giveback_code,json=givebackCode,proto3,oneof"` +} + +func (*SyncRequest_Ping) isSyncRequest_Message() {} + +func (*SyncRequest_ValidateCode) isSyncRequest_Message() {} + +func (*SyncRequest_ChangeCode) isSyncRequest_Message() {} + +func (*SyncRequest_GivebackCode) isSyncRequest_Message() {} + +type SyncPush struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Message: + // + // *SyncPush_Pong + // *SyncPush_ValidateResult + // *SyncPush_ChangeCodeResult + // *SyncPush_GivebackCodeResult + Message isSyncPush_Message `protobuf_oneof:"message"` +} + +func (x *SyncPush) Reset() { + *x = SyncPush{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_server_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SyncPush) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncPush) ProtoMessage() {} + +func (x *SyncPush) ProtoReflect() protoreflect.Message { + mi := &file_proto_server_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SyncPush.ProtoReflect.Descriptor instead. +func (*SyncPush) Descriptor() ([]byte, []int) { + return file_proto_server_proto_rawDescGZIP(), []int{7} +} + +func (m *SyncPush) GetMessage() isSyncPush_Message { + if m != nil { + return m.Message + } + return nil +} + +func (x *SyncPush) GetPong() *emptypb.Empty { + if x, ok := x.GetMessage().(*SyncPush_Pong); ok { + return x.Pong + } + return nil +} + +func (x *SyncPush) GetValidateResult() *ValidateResult { + if x, ok := x.GetMessage().(*SyncPush_ValidateResult); ok { + return x.ValidateResult + } + return nil +} + +func (x *SyncPush) GetChangeCodeResult() *ChangeCodeResult { + if x, ok := x.GetMessage().(*SyncPush_ChangeCodeResult); ok { + return x.ChangeCodeResult + } + return nil +} + +func (x *SyncPush) GetGivebackCodeResult() *GiveBackCodeResult { + if x, ok := x.GetMessage().(*SyncPush_GivebackCodeResult); ok { + return x.GivebackCodeResult + } + return nil +} + +type isSyncPush_Message interface { + isSyncPush_Message() +} + +type SyncPush_Pong struct { + Pong *emptypb.Empty `protobuf:"bytes,1,opt,name=pong,proto3,oneof"` +} + +type SyncPush_ValidateResult struct { + ValidateResult *ValidateResult `protobuf:"bytes,2,opt,name=validate_result,json=validateResult,proto3,oneof"` +} + +type SyncPush_ChangeCodeResult struct { + ChangeCodeResult *ChangeCodeResult `protobuf:"bytes,3,opt,name=change_code_result,json=changeCodeResult,proto3,oneof"` +} + +type SyncPush_GivebackCodeResult struct { + GivebackCodeResult *GiveBackCodeResult `protobuf:"bytes,4,opt,name=giveback_code_result,json=givebackCodeResult,proto3,oneof"` +} + +func (*SyncPush_Pong) isSyncPush_Message() {} + +func (*SyncPush_ValidateResult) isSyncPush_Message() {} + +func (*SyncPush_ChangeCodeResult) isSyncPush_Message() {} + +func (*SyncPush_GivebackCodeResult) isSyncPush_Message() {} + +type IPInfoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *IPInfoRequest) Reset() { + *x = IPInfoRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_server_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IPInfoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IPInfoRequest) ProtoMessage() {} + +func (x *IPInfoRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_server_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IPInfoRequest.ProtoReflect.Descriptor instead. +func (*IPInfoRequest) Descriptor() ([]byte, []int) { + return file_proto_server_proto_rawDescGZIP(), []int{8} +} + +type IPInfoResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Ip string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"` + Country string `protobuf:"bytes,2,opt,name=country,proto3" json:"country,omitempty"` + Province string `protobuf:"bytes,3,opt,name=province,proto3" json:"province,omitempty"` + City string `protobuf:"bytes,4,opt,name=city,proto3" json:"city,omitempty"` + Areacode string `protobuf:"bytes,5,opt,name=areacode,proto3" json:"areacode,omitempty"` + Timezone string `protobuf:"bytes,6,opt,name=timezone,proto3" json:"timezone,omitempty"` + Zipcode string `protobuf:"bytes,7,opt,name=zipcode,proto3" json:"zipcode,omitempty"` + Lngwgs string `protobuf:"bytes,8,opt,name=lngwgs,proto3" json:"lngwgs,omitempty"` + Latwgs string `protobuf:"bytes,9,opt,name=latwgs,proto3" json:"latwgs,omitempty"` + Isp string `protobuf:"bytes,10,opt,name=isp,proto3" json:"isp,omitempty"` + Owner string `protobuf:"bytes,11,opt,name=owner,proto3" json:"owner,omitempty"` + Adcode string `protobuf:"bytes,12,opt,name=adcode,proto3" json:"adcode,omitempty"` +} + +func (x *IPInfoResponse) Reset() { + *x = IPInfoResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_server_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IPInfoResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IPInfoResponse) ProtoMessage() {} + +func (x *IPInfoResponse) ProtoReflect() protoreflect.Message { + mi := &file_proto_server_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IPInfoResponse.ProtoReflect.Descriptor instead. +func (*IPInfoResponse) Descriptor() ([]byte, []int) { + return file_proto_server_proto_rawDescGZIP(), []int{9} +} + +func (x *IPInfoResponse) GetIp() string { + if x != nil { + return x.Ip + } + return "" +} + +func (x *IPInfoResponse) GetCountry() string { + if x != nil { + return x.Country + } + return "" +} + +func (x *IPInfoResponse) GetProvince() string { + if x != nil { + return x.Province + } + return "" +} + +func (x *IPInfoResponse) GetCity() string { + if x != nil { + return x.City + } + return "" +} + +func (x *IPInfoResponse) GetAreacode() string { + if x != nil { + return x.Areacode + } + return "" +} + +func (x *IPInfoResponse) GetTimezone() string { + if x != nil { + return x.Timezone + } + return "" +} + +func (x *IPInfoResponse) GetZipcode() string { + if x != nil { + return x.Zipcode + } + return "" +} + +func (x *IPInfoResponse) GetLngwgs() string { + if x != nil { + return x.Lngwgs + } + return "" +} + +func (x *IPInfoResponse) GetLatwgs() string { + if x != nil { + return x.Latwgs + } + return "" +} + +func (x *IPInfoResponse) GetIsp() string { + if x != nil { + return x.Isp + } + return "" +} + +func (x *IPInfoResponse) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +func (x *IPInfoResponse) GetAdcode() string { + if x != nil { + return x.Adcode + } + return "" +} + +var File_proto_server_proto protoreflect.FileDescriptor + +var file_proto_server_proto_rawDesc = []byte{ + 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x24, 0x63, 0x68, 0x61, 0x69, 0x74, 0x69, 0x6e, 0x2e, 0x73, 0x61, + 0x66, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x6f, 0x70, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, + 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6b, 0x0a, 0x0c, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, + 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x64, 0x22, 0x70, 0x0a, 0x0a, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x43, 0x6f, + 0x64, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x65, 0x77, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x77, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, + 0x0a, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x6b, 0x0a, 0x0c, 0x47, 0x69, 0x76, 0x65, 0x42, 0x61, + 0x63, 0x6b, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, + 0x63, 0x68, 0x69, 0x6e, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x02, 0x69, 0x64, 0x22, 0x89, 0x02, 0x0a, 0x0e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x4d, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x37, 0x2e, 0x63, 0x68, 0x61, 0x69, 0x74, 0x69, 0x6e, 0x2e, + 0x73, 0x61, 0x66, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x6f, 0x70, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, + 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, + 0x65, 0x64, 0x41, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x72, 0x67, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x15, 0x0a, 0x06, 0x6f, 0x72, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x6f, 0x72, 0x67, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x47, 0x0a, 0x07, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2d, 0x2e, 0x63, 0x68, 0x61, 0x69, 0x74, 0x69, + 0x6e, 0x2e, 0x73, 0x61, 0x66, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x6f, 0x70, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x45, + 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, + 0x8b, 0x02, 0x0a, 0x10, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x12, 0x4d, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x37, 0x2e, 0x63, 0x68, 0x61, 0x69, 0x74, 0x69, 0x6e, 0x2e, 0x73, 0x61, + 0x66, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x6f, 0x70, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x61, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, + 0x41, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x72, 0x67, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x15, 0x0a, + 0x06, 0x6f, 0x72, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, + 0x72, 0x67, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x47, 0x0a, 0x07, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2d, 0x2e, 0x63, 0x68, 0x61, 0x69, 0x74, 0x69, 0x6e, 0x2e, + 0x73, 0x61, 0x66, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x6f, 0x70, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x45, 0x64, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x73, 0x0a, + 0x12, 0x47, 0x69, 0x76, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x12, 0x4d, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x37, 0x2e, 0x63, 0x68, 0x61, 0x69, 0x74, 0x69, 0x6e, 0x2e, 0x73, 0x61, 0x66, + 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x6f, 0x70, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x76, 0x31, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x69, 0x76, 0x65, 0x42, 0x61, + 0x63, 0x6b, 0x43, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x22, 0xd1, 0x02, 0x0a, 0x0b, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x04, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x48, 0x00, 0x52, 0x04, 0x70, 0x69, 0x6e, 0x67, + 0x12, 0x59, 0x0a, 0x0d, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x6f, 0x64, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x63, 0x68, 0x61, 0x69, 0x74, 0x69, + 0x6e, 0x2e, 0x73, 0x61, 0x66, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x6f, 0x70, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x48, 0x00, 0x52, 0x0c, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x53, 0x0a, 0x0b, 0x63, + 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x30, 0x2e, 0x63, 0x68, 0x61, 0x69, 0x74, 0x69, 0x6e, 0x2e, 0x73, 0x61, 0x66, 0x65, 0x6c, + 0x69, 0x6e, 0x65, 0x5f, 0x6f, 0x70, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x43, 0x6f, + 0x64, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x43, 0x6f, 0x64, 0x65, + 0x12, 0x59, 0x0a, 0x0d, 0x67, 0x69, 0x76, 0x65, 0x62, 0x61, 0x63, 0x6b, 0x5f, 0x63, 0x6f, 0x64, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x63, 0x68, 0x61, 0x69, 0x74, 0x69, + 0x6e, 0x2e, 0x73, 0x61, 0x66, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x6f, 0x70, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x47, + 0x69, 0x76, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x43, 0x6f, 0x64, 0x65, 0x48, 0x00, 0x52, 0x0c, 0x67, + 0x69, 0x76, 0x65, 0x62, 0x61, 0x63, 0x6b, 0x43, 0x6f, 0x64, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xfa, 0x02, 0x0a, 0x08, 0x53, 0x79, 0x6e, 0x63, 0x50, + 0x75, 0x73, 0x68, 0x12, 0x2c, 0x0a, 0x04, 0x70, 0x6f, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x48, 0x00, 0x52, 0x04, 0x70, 0x6f, 0x6e, + 0x67, 0x12, 0x5f, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x63, 0x68, 0x61, + 0x69, 0x74, 0x69, 0x6e, 0x2e, 0x73, 0x61, 0x66, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x6f, 0x70, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x48, 0x00, 0x52, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x12, 0x66, 0x0a, 0x12, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x64, + 0x65, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, + 0x2e, 0x63, 0x68, 0x61, 0x69, 0x74, 0x69, 0x6e, 0x2e, 0x73, 0x61, 0x66, 0x65, 0x6c, 0x69, 0x6e, + 0x65, 0x5f, 0x6f, 0x70, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x43, 0x6f, 0x64, 0x65, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x48, 0x00, 0x52, 0x10, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x6c, 0x0a, 0x14, 0x67, 0x69, + 0x76, 0x65, 0x62, 0x61, 0x63, 0x6b, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x63, 0x68, 0x61, 0x69, 0x74, + 0x69, 0x6e, 0x2e, 0x73, 0x61, 0x66, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x6f, 0x70, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, + 0x47, 0x69, 0x76, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x48, 0x00, 0x52, 0x12, 0x67, 0x69, 0x76, 0x65, 0x62, 0x61, 0x63, 0x6b, 0x43, 0x6f, + 0x64, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x42, 0x09, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x22, 0x0f, 0x0a, 0x0d, 0x49, 0x50, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x22, 0xac, 0x02, 0x0a, 0x0e, 0x49, 0x50, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x63, 0x69, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x69, 0x74, + 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x72, 0x65, 0x61, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x72, 0x65, 0x61, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, + 0x08, 0x74, 0x69, 0x6d, 0x65, 0x7a, 0x6f, 0x6e, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x74, 0x69, 0x6d, 0x65, 0x7a, 0x6f, 0x6e, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x7a, 0x69, 0x70, + 0x63, 0x6f, 0x64, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x7a, 0x69, 0x70, 0x63, + 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x6e, 0x67, 0x77, 0x67, 0x73, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x6c, 0x6e, 0x67, 0x77, 0x67, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x6c, + 0x61, 0x74, 0x77, 0x67, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6c, 0x61, 0x74, + 0x77, 0x67, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x73, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x69, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x0b, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x61, + 0x64, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x64, 0x63, + 0x6f, 0x64, 0x65, 0x2a, 0xb7, 0x01, 0x0a, 0x11, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, + 0x43, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1f, 0x0a, 0x1b, 0x56, 0x41, 0x4c, + 0x49, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, + 0x5f, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x00, 0x12, 0x1f, 0x0a, 0x1b, 0x56, 0x41, + 0x4c, 0x49, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, + 0x45, 0x5f, 0x45, 0x58, 0x50, 0x49, 0x52, 0x45, 0x44, 0x10, 0x01, 0x12, 0x1f, 0x0a, 0x1b, 0x56, + 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x53, 0x54, 0x41, + 0x54, 0x45, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x02, 0x12, 0x1c, 0x0a, 0x18, + 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x53, 0x54, + 0x41, 0x54, 0x45, 0x5f, 0x55, 0x53, 0x45, 0x44, 0x10, 0x03, 0x12, 0x21, 0x0a, 0x1d, 0x56, 0x41, + 0x4c, 0x49, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, + 0x45, 0x5f, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, 0x04, 0x2a, 0x4f, 0x0a, + 0x07, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x0e, 0x45, 0x44, 0x49, 0x54, + 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x4b, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x14, + 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x46, 0x45, 0x53, 0x53, 0x49, + 0x4f, 0x4e, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, + 0x4e, 0x5f, 0x45, 0x4e, 0x54, 0x45, 0x52, 0x50, 0x52, 0x49, 0x53, 0x45, 0x10, 0x02, 0x2a, 0x54, + 0x0a, 0x11, 0x47, 0x69, 0x76, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x43, 0x6f, 0x64, 0x65, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x12, 0x1f, 0x0a, 0x1b, 0x47, 0x49, 0x56, 0x45, 0x42, 0x41, 0x43, 0x4b, 0x5f, + 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x55, 0x43, 0x43, 0x45, + 0x53, 0x53, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x1a, 0x47, 0x49, 0x56, 0x45, 0x42, 0x41, 0x43, 0x4b, + 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x46, 0x41, 0x49, 0x4c, + 0x45, 0x44, 0x10, 0x01, 0x32, 0xec, 0x01, 0x0a, 0x06, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, + 0x6d, 0x0a, 0x04, 0x53, 0x79, 0x6e, 0x63, 0x12, 0x31, 0x2e, 0x63, 0x68, 0x61, 0x69, 0x74, 0x69, + 0x6e, 0x2e, 0x73, 0x61, 0x66, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x6f, 0x70, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, + 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x63, 0x68, 0x61, + 0x69, 0x74, 0x69, 0x6e, 0x2e, 0x73, 0x61, 0x66, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x6f, 0x70, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x75, 0x73, 0x68, 0x28, 0x01, 0x30, 0x01, 0x12, 0x73, + 0x0a, 0x06, 0x49, 0x50, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x33, 0x2e, 0x63, 0x68, 0x61, 0x69, 0x74, + 0x69, 0x6e, 0x2e, 0x73, 0x61, 0x66, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x6f, 0x70, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, + 0x49, 0x50, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, + 0x63, 0x68, 0x61, 0x69, 0x74, 0x69, 0x6e, 0x2e, 0x73, 0x61, 0x66, 0x65, 0x6c, 0x69, 0x6e, 0x65, + 0x5f, 0x6f, 0x70, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x2e, 0x49, 0x50, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x42, 0x1a, 0x5a, 0x18, 0x73, 0x61, 0x66, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_proto_server_proto_rawDescOnce sync.Once + file_proto_server_proto_rawDescData = file_proto_server_proto_rawDesc +) + +func file_proto_server_proto_rawDescGZIP() []byte { + file_proto_server_proto_rawDescOnce.Do(func() { + file_proto_server_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_server_proto_rawDescData) + }) + return file_proto_server_proto_rawDescData +} + +var file_proto_server_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_proto_server_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_proto_server_proto_goTypes = []any{ + (ValidateCodeState)(0), // 0: chaitin.safeline_ops.proto.v1.server.ValidateCodeState + (Edition)(0), // 1: chaitin.safeline_ops.proto.v1.server.Edition + (GiveBackCodeState)(0), // 2: chaitin.safeline_ops.proto.v1.server.GiveBackCodeState + (*ValidateCode)(nil), // 3: chaitin.safeline_ops.proto.v1.server.ValidateCode + (*ChangeCode)(nil), // 4: chaitin.safeline_ops.proto.v1.server.ChangeCode + (*GiveBackCode)(nil), // 5: chaitin.safeline_ops.proto.v1.server.GiveBackCode + (*ValidateResult)(nil), // 6: chaitin.safeline_ops.proto.v1.server.ValidateResult + (*ChangeCodeResult)(nil), // 7: chaitin.safeline_ops.proto.v1.server.ChangeCodeResult + (*GiveBackCodeResult)(nil), // 8: chaitin.safeline_ops.proto.v1.server.GiveBackCodeResult + (*SyncRequest)(nil), // 9: chaitin.safeline_ops.proto.v1.server.SyncRequest + (*SyncPush)(nil), // 10: chaitin.safeline_ops.proto.v1.server.SyncPush + (*IPInfoRequest)(nil), // 11: chaitin.safeline_ops.proto.v1.server.IPInfoRequest + (*IPInfoResponse)(nil), // 12: chaitin.safeline_ops.proto.v1.server.IPInfoResponse + (*emptypb.Empty)(nil), // 13: google.protobuf.Empty +} +var file_proto_server_proto_depIdxs = []int32{ + 0, // 0: chaitin.safeline_ops.proto.v1.server.ValidateResult.state:type_name -> chaitin.safeline_ops.proto.v1.server.ValidateCodeState + 1, // 1: chaitin.safeline_ops.proto.v1.server.ValidateResult.edition:type_name -> chaitin.safeline_ops.proto.v1.server.Edition + 0, // 2: chaitin.safeline_ops.proto.v1.server.ChangeCodeResult.state:type_name -> chaitin.safeline_ops.proto.v1.server.ValidateCodeState + 1, // 3: chaitin.safeline_ops.proto.v1.server.ChangeCodeResult.edition:type_name -> chaitin.safeline_ops.proto.v1.server.Edition + 2, // 4: chaitin.safeline_ops.proto.v1.server.GiveBackCodeResult.state:type_name -> chaitin.safeline_ops.proto.v1.server.GiveBackCodeState + 13, // 5: chaitin.safeline_ops.proto.v1.server.SyncRequest.ping:type_name -> google.protobuf.Empty + 3, // 6: chaitin.safeline_ops.proto.v1.server.SyncRequest.validate_code:type_name -> chaitin.safeline_ops.proto.v1.server.ValidateCode + 4, // 7: chaitin.safeline_ops.proto.v1.server.SyncRequest.change_code:type_name -> chaitin.safeline_ops.proto.v1.server.ChangeCode + 5, // 8: chaitin.safeline_ops.proto.v1.server.SyncRequest.giveback_code:type_name -> chaitin.safeline_ops.proto.v1.server.GiveBackCode + 13, // 9: chaitin.safeline_ops.proto.v1.server.SyncPush.pong:type_name -> google.protobuf.Empty + 6, // 10: chaitin.safeline_ops.proto.v1.server.SyncPush.validate_result:type_name -> chaitin.safeline_ops.proto.v1.server.ValidateResult + 7, // 11: chaitin.safeline_ops.proto.v1.server.SyncPush.change_code_result:type_name -> chaitin.safeline_ops.proto.v1.server.ChangeCodeResult + 8, // 12: chaitin.safeline_ops.proto.v1.server.SyncPush.giveback_code_result:type_name -> chaitin.safeline_ops.proto.v1.server.GiveBackCodeResult + 9, // 13: chaitin.safeline_ops.proto.v1.server.Server.Sync:input_type -> chaitin.safeline_ops.proto.v1.server.SyncRequest + 11, // 14: chaitin.safeline_ops.proto.v1.server.Server.IPInfo:input_type -> chaitin.safeline_ops.proto.v1.server.IPInfoRequest + 10, // 15: chaitin.safeline_ops.proto.v1.server.Server.Sync:output_type -> chaitin.safeline_ops.proto.v1.server.SyncPush + 12, // 16: chaitin.safeline_ops.proto.v1.server.Server.IPInfo:output_type -> chaitin.safeline_ops.proto.v1.server.IPInfoResponse + 15, // [15:17] is the sub-list for method output_type + 13, // [13:15] is the sub-list for method input_type + 13, // [13:13] is the sub-list for extension type_name + 13, // [13:13] is the sub-list for extension extendee + 0, // [0:13] is the sub-list for field type_name +} + +func init() { file_proto_server_proto_init() } +func file_proto_server_proto_init() { + if File_proto_server_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_proto_server_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*ValidateCode); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_server_proto_msgTypes[1].Exporter = func(v any, i int) any { + switch v := v.(*ChangeCode); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_server_proto_msgTypes[2].Exporter = func(v any, i int) any { + switch v := v.(*GiveBackCode); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_server_proto_msgTypes[3].Exporter = func(v any, i int) any { + switch v := v.(*ValidateResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_server_proto_msgTypes[4].Exporter = func(v any, i int) any { + switch v := v.(*ChangeCodeResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_server_proto_msgTypes[5].Exporter = func(v any, i int) any { + switch v := v.(*GiveBackCodeResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_server_proto_msgTypes[6].Exporter = func(v any, i int) any { + switch v := v.(*SyncRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_server_proto_msgTypes[7].Exporter = func(v any, i int) any { + switch v := v.(*SyncPush); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_server_proto_msgTypes[8].Exporter = func(v any, i int) any { + switch v := v.(*IPInfoRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_server_proto_msgTypes[9].Exporter = func(v any, i int) any { + switch v := v.(*IPInfoResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_proto_server_proto_msgTypes[6].OneofWrappers = []any{ + (*SyncRequest_Ping)(nil), + (*SyncRequest_ValidateCode)(nil), + (*SyncRequest_ChangeCode)(nil), + (*SyncRequest_GivebackCode)(nil), + } + file_proto_server_proto_msgTypes[7].OneofWrappers = []any{ + (*SyncPush_Pong)(nil), + (*SyncPush_ValidateResult)(nil), + (*SyncPush_ChangeCodeResult)(nil), + (*SyncPush_GivebackCodeResult)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_proto_server_proto_rawDesc, + NumEnums: 3, + NumMessages: 10, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_proto_server_proto_goTypes, + DependencyIndexes: file_proto_server_proto_depIdxs, + EnumInfos: file_proto_server_proto_enumTypes, + MessageInfos: file_proto_server_proto_msgTypes, + }.Build() + File_proto_server_proto = out.File + file_proto_server_proto_rawDesc = nil + file_proto_server_proto_goTypes = nil + file_proto_server_proto_depIdxs = nil +} diff --git a/activate/safeline/proto/v1/server/proto_server_grpc.pb.go b/activate/safeline/proto/v1/server/proto_server_grpc.pb.go new file mode 100644 index 0000000..e00c40d --- /dev/null +++ b/activate/safeline/proto/v1/server/proto_server_grpc.pb.go @@ -0,0 +1,154 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.29.1 +// source: proto_server.proto + +package server + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + Server_Sync_FullMethodName = "/chaitin.safeline_ops.proto.v1.server.Server/Sync" + Server_IPInfo_FullMethodName = "/chaitin.safeline_ops.proto.v1.server.Server/IPInfo" +) + +// ServerClient is the client API for Server service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ServerClient interface { + Sync(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[SyncRequest, SyncPush], error) + IPInfo(ctx context.Context, in *IPInfoRequest, opts ...grpc.CallOption) (*IPInfoResponse, error) +} + +type serverClient struct { + cc grpc.ClientConnInterface +} + +func NewServerClient(cc grpc.ClientConnInterface) ServerClient { + return &serverClient{cc} +} + +func (c *serverClient) Sync(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[SyncRequest, SyncPush], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &Server_ServiceDesc.Streams[0], Server_Sync_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[SyncRequest, SyncPush]{ClientStream: stream} + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type Server_SyncClient = grpc.BidiStreamingClient[SyncRequest, SyncPush] + +func (c *serverClient) IPInfo(ctx context.Context, in *IPInfoRequest, opts ...grpc.CallOption) (*IPInfoResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(IPInfoResponse) + err := c.cc.Invoke(ctx, Server_IPInfo_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ServerServer is the server API for Server service. +// All implementations must embed UnimplementedServerServer +// for forward compatibility. +type ServerServer interface { + Sync(grpc.BidiStreamingServer[SyncRequest, SyncPush]) error + IPInfo(context.Context, *IPInfoRequest) (*IPInfoResponse, error) + mustEmbedUnimplementedServerServer() +} + +// UnimplementedServerServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedServerServer struct{} + +func (UnimplementedServerServer) Sync(grpc.BidiStreamingServer[SyncRequest, SyncPush]) error { + return status.Errorf(codes.Unimplemented, "method Sync not implemented") +} +func (UnimplementedServerServer) IPInfo(context.Context, *IPInfoRequest) (*IPInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method IPInfo not implemented") +} +func (UnimplementedServerServer) mustEmbedUnimplementedServerServer() {} +func (UnimplementedServerServer) testEmbeddedByValue() {} + +// UnsafeServerServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ServerServer will +// result in compilation errors. +type UnsafeServerServer interface { + mustEmbedUnimplementedServerServer() +} + +func RegisterServerServer(s grpc.ServiceRegistrar, srv ServerServer) { + // If the following call pancis, it indicates UnimplementedServerServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&Server_ServiceDesc, srv) +} + +func _Server_Sync_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(ServerServer).Sync(&grpc.GenericServerStream[SyncRequest, SyncPush]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type Server_SyncServer = grpc.BidiStreamingServer[SyncRequest, SyncPush] + +func _Server_IPInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IPInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServerServer).IPInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Server_IPInfo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServerServer).IPInfo(ctx, req.(*IPInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Server_ServiceDesc is the grpc.ServiceDesc for Server service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Server_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "chaitin.safeline_ops.proto.v1.server.Server", + HandlerType: (*ServerServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "IPInfo", + Handler: _Server_IPInfo_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "Sync", + Handler: _Server_Sync_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "proto_server.proto", +} diff --git a/extract/descpb_to_proto.py b/extract/descpb_to_proto.py new file mode 100644 index 0000000..a8e8b77 --- /dev/null +++ b/extract/descpb_to_proto.py @@ -0,0 +1,241 @@ +#!/usr/bin/python3 +#-*- encoding: Utf-8 -*- +from google.protobuf.descriptor_pb2 import DescriptorProto, FieldDescriptorProto +from collections import OrderedDict +from itertools import groupby + +""" + This script converts back a FileDescriptor structure to a readable .proto file. + + There is already a function in the standard C++ library that does this [1], but + - It is not accessible through the Python binding + - This implementation has a few output readability improvements, i.e + -- Declaring enums/messages after first use rather than at top of block + -- Not always using full names when referencing messages types + -- Smaller aesthetic differences (number of tabs, line jumps) + + For reference of the FileDescriptor structure, see [2]. + Other (less complete) implementations of this are [3] or [4]. + + [1] https://github.com/google/protobuf/blob/5a76e/src/google/protobuf/descriptor.cc#L2242 + [2] https://github.com/google/protobuf/blob/bb77c/src/google/protobuf/descriptor.proto#L59 + + [3] https://github.com/fry/d3/blob/master/decompile_protobins.py + [4] https://github.com/sarum9in/bunsan_binlogs_python/blob/master/src/python/source.py +""" + +INDENT = ' ' * 4 + +def descpb_to_proto(desc): + out = 'syntax = "%s";\n\n' % (desc.syntax or 'proto2') + + scopes = [''] + if desc.package: + out += 'package %s;\n\n' % desc.package + scopes[0] += '.' + desc.package + + for index, dep in enumerate(desc.dependency): + prefix = ' public' * (index in desc.public_dependency) + prefix += ' weak' * (index in desc.weak_dependency) + out += 'import%s "%s";\n' % (prefix, dep) + scopes.append('.' + ('/' + dep.rsplit('/', 1)[0])[1:].replace('/', '.')) + + out += '\n' * (out[-2] != '\n') + + out += parse_msg(desc, scopes, desc.syntax).strip('\n') + name = desc.name.replace('..', '').strip('.\\/') + + return name, out + '\n' + +def parse_msg(desc, scopes, syntax): + out = '' + is_msg = isinstance(desc, DescriptorProto) + + if is_msg: + scopes = list(scopes) + scopes[0] += '.' + desc.name + + blocks = OrderedDict() + for nested_msg in (desc.nested_type if is_msg else desc.message_type): + blocks[nested_msg.name] = parse_msg(nested_msg, scopes, syntax) + + for enum in desc.enum_type: + out2 = '' + for val in enum.value: + out2 += '%s = %s;\n' % (val.name, fmt_value(val.number, val.options)) + + if len(set(i.number for i in enum.value)) == len(enum.value): + enum.options.ClearField('allow_alias') + + blocks[enum.name] = wrap_block('enum', out2, enum) + + if is_msg and desc.options.map_entry: + return ' map<%s>' % ', '.join(min_name(i.type_name, scopes) \ + if i.type_name else types[i.type] \ + for i in desc.field) + + if is_msg: + for field in desc.field: + out += fmt_field(field, scopes, blocks, syntax) + + for index, oneof in enumerate(desc.oneof_decl): + out += wrap_block('oneof', blocks.pop('_oneof_%d' % index), oneof) + + out += fmt_ranges('extensions', desc.extension_range) + out += fmt_ranges('reserved', [*desc.reserved_range, *desc.reserved_name]) + + else: + for service in desc.service: + out2 = '' + for method in service.method: + out2 += 'rpc %s(%s%s) returns (%s%s);\n' % (method.name, + 'stream ' * method.client_streaming, + min_name(method.input_type, scopes), + 'stream ' * method.server_streaming, + min_name(method.output_type, scopes)) + + out += wrap_block('service', out2, service) + + extendees = OrderedDict() + for ext in desc.extension: + extendees.setdefault(ext.extendee, '') + extendees[ext.extendee] += fmt_field(ext, scopes, blocks, syntax, True) + + for name, value in blocks.items(): + out += value[:-1] + + for name, fields in extendees.items(): + out += wrap_block('extend', fields, name=min_name(name, scopes)) + + out = wrap_block('message' * is_msg, out, desc) + return out + +def fmt_value(val, options=None, desc=None, optarr=[]): + if type(val) != str: + if type(val) == bool: + val = str(val).lower() + elif desc and desc.enum_type: + val = desc.enum_type.values_by_number[val].name + val = str(val) + else: + val = '"%s"' % val.encode('unicode_escape').decode('utf8') + + if options: + opts = [*optarr] + for (option, value) in options.ListFields(): + opts.append('%s = %s' % (option.name, fmt_value(value, desc=option))) + if opts: + val += ' [%s]' % ', '.join(opts) + return val + +types = {v: k.split('_')[1].lower() for k, v in FieldDescriptorProto.Type.items()} +labels = {v: k.split('_')[1].lower() for k, v in FieldDescriptorProto.Label.items()} + +def fmt_field(field, scopes, blocks, syntax, extend=False): + type_ = types[field.type] + + default = '' + if field.default_value: + if field.type == field.TYPE_STRING: + default = ['default = %s' % fmt_value(field.default_value)] + elif field.type == field.TYPE_BYTES: + default = ['default = "%s"' % field.default_value] + else: + # Guess whether it ought to be more readable as base 10 or 16, + # based on the presence of repeated digits: + + if ('int' in type_ or 'fixed' in type_) and \ + int(field.default_value) >= 0x10000 and \ + not any(len(list(i)) > 3 for _, i in groupby(str(field.default_value))): + + field.default_value = hex(int(field.default_value)) + + default = ['default = %s' % field.default_value] + + out = '' + if field.type_name: + type_ = min_name(field.type_name, scopes) + short_type = type_.split('.')[-1] + + if short_type in blocks and ((not extend and not field.HasField('oneof_index')) or \ + blocks[short_type].startswith(' map<')): + out += blocks.pop(short_type)[1:] + + if out.startswith('map<'): + line = out + ' %s = %s;\n' % (field.name, fmt_value(field.number, field.options, optarr=default)) + out = '' + elif field.type != field.TYPE_GROUP: + line = '%s %s %s = %s;\n' % (labels[field.label], type_, field.name, fmt_value(field.number, field.options, optarr=default)) + else: + line = '%s group %s = %d ' % (labels[field.label], type_, field.number) + out = out.split(' ', 2)[-1] + + if field.HasField('oneof_index') or (syntax == 'proto3' and line.startswith('optional')): + line = line.split(' ', 1)[-1] + if out: + line = '\n' + line + + if field.HasField('oneof_index'): + blocks.setdefault('_oneof_%d' % field.oneof_index, '') + blocks['_oneof_%d' % field.oneof_index] += line + out + return '' + else: + return line + out + +""" + Find the smallest name to refer to another message from our scopes. + + For this, we take the final part of its name, and expand it until + the path both scopes don't have in common (if any) is specified; and + expand it again if there are multiple outer packages/messages in the + scopes sharing the same name, and that the first part of the obtained + partial name is one of them, leading to ambiguity. +""" + +def min_name(name, scopes): + name, cur_scope = name.split('.'), scopes[0].split('.') + short_name = [name.pop()] + + while name and (cur_scope[:len(name)] != name or \ + any(list_rfind(scope.split('.'), short_name[0]) > len(name) \ + for scope in scopes)): + short_name.insert(0, name.pop()) + + return '.'.join(short_name) + +def wrap_block(type_, value, desc=None, name=None): + out = '' + if type_: + out = '\n%s %s {\n' % (type_, name or desc.name) + + if desc: + for (option, optval) in desc.options.ListFields(): + value = 'option %s = %s;\n' % (option.name, fmt_value(optval, desc=option)) + value + + value = value.replace('\n\n\n', '\n\n') + if type_: + out += '\n'.join(INDENT + line for line in value.strip('\n').split('\n')) + out += '\n}\n\n' + else: + out += value + return out + +def fmt_ranges(name, ranges): + text = [] + for range_ in ranges: + if type(range_) != str and range_.end - 1 > range_.start: + if range_.end < 0x20000000: + text.append('%d to %d' % (range_.start, range_.end - 1)) + else: + text.append('%d to max' % range_.start) + elif type(range_) != str: + text.append(fmt_value(range_.start)) + else: + text.append(fmt_value(range_)) + if text: + return '\n%s %s;\n' % (name, ', '.join(text)) + return '' + + +# Fulfilling a blatant lack of the Python language. +list_rfind = lambda x, i: len(x) - 1 - x[::-1].index(i) if i in x else -1 \ No newline at end of file diff --git a/extract/grpc.py b/extract/grpc.py new file mode 100644 index 0000000..49da23a --- /dev/null +++ b/extract/grpc.py @@ -0,0 +1,74 @@ +#!/usr/bin/python3 +# -*- encoding: Utf-8 -*- +from pathlib import Path + +from google.protobuf.descriptor_pb2 import FileDescriptorProto +from google.protobuf.internal.decoder import _DecodeVarint + +from extract.descpb_to_proto import descpb_to_proto + + +def walk_binary(binr): + with open(binr, "rb") as fd: + binr = fd.read() + + # Search for: + # ".proto" or ".protodevel", as part of the "name" (1) field + cursor = 0 + while cursor < len(binr): + cursor = binr.find(b".proto", cursor) + + if cursor == -1: + break + cursor += len(".proto") + cursor += (binr[cursor : cursor + 5] == b"devel") * 5 + + # Search back for the (1, length-delimited) marker + start = binr.rfind(b"\x0a", max(cursor - 1024, 0), cursor) + + if start > 0 and binr[start - 1] == 0x0A == (cursor - start - 1): + start -= 1 + + # Check whether length byte is coherent + if start == -1: + continue + varint, end = _DecodeVarint(binr, start + 1) + if cursor - end != varint: + continue + + # Look just after for subsequent markers + tags = b"\x12\x1a\x22\x2a\x32\x3a\x42\x4a\x50\x58\x62" + if binr[cursor] not in tags: + continue + + while cursor < len(binr) and binr[cursor] in tags: + tags = tags[tags.index(binr[cursor]) :] + + varint, end = _DecodeVarint(binr, cursor + 1) + cursor = end + varint * (binr[cursor] & 0b111 == 2) + + # Parse descriptor + proto = FileDescriptorProto() + proto.ParseFromString(binr[start:cursor]) + + # Convert to ascii + yield descpb_to_proto(proto) + + +if __name__ == "__main__": + base = Path(__file__).resolve().parent + proto_base = base / "proto" + proto_base.mkdir(exist_ok=True) + + for name, proto in walk_binary("./mgt"): + if ( + name.startswith("google") + or name.startswith("grpc") + or name.startswith("github.com/golang/protobuf") + ): + continue + p = proto_base / name + p.parent.mkdir(parents=True, exist_ok=True) + print(p) + with open(p, "w") as fd: + fd.write(proto) diff --git a/extract/proto/fvm.proto b/extract/proto/fvm.proto new file mode 100644 index 0000000..2886479 --- /dev/null +++ b/extract/proto/fvm.proto @@ -0,0 +1,63 @@ +syntax = "proto3"; + +package safeline_fvm; + +option go_package = "proto/fvm;safeline_fvm"; + +service FVM { + rpc AppendFSL(stream Text) returns (Status); + rpc GetVersion(Empty) returns (VersionInfo); + rpc GetBytecode(Version) returns (stream Chunk); + rpc GetFSL(Version) returns (stream Chunk); + rpc GetTableSVG(Empty) returns (stream Chunk); + rpc CompileFSL(FslText) returns (Status); + rpc GetPartFSL(FslInfo) returns (FslText); + rpc GetPartDot(FslInfo) returns (stream Chunk); + rpc UpdateState(StateText) returns (StateText); +} + +message StateText { + string Text = 1; +} + +message FslInfo { + string TaName = 1; + string Id = 2; +} + +message FslText { + string Text = 1; +} + +message Text { + bool Incremental = 1; + string Text = 3; +} + +message Status { + bool Ok = 1; + string Err = 2; + int64 Version = 3; +} + +message Empty { + +} + +message VersionInfo { + int64 Latest = 1; + int64 Oldest = 2; +} + +message Version { + int64 From = 1; +} + +message Chunk { + bool Ok = 1; + string Err = 2; + int64 Version = 3; + bytes Payload = 4; + int64 NumChunks = 5; + int64 ChunkIndex = 6; +} diff --git a/extract/proto/mgt/server/proto/sync/sync.proto b/extract/proto/mgt/server/proto/sync/sync.proto new file mode 100644 index 0000000..d210edd --- /dev/null +++ b/extract/proto/mgt/server/proto/sync/sync.proto @@ -0,0 +1,76 @@ +syntax = "proto3"; + +import "google/protobuf/empty.proto"; + +option go_package = "proto/sync"; + +service SyncService { + rpc Sync(stream SyncRequest) returns (stream SyncTask); +} + +message SyncRequest { + oneof message { + google.protobuf.Empty ping = 1; + TableStatus table_status = 2; + TaskResult task_result = 3; + int64 fetch_static = 4; + ClientStatus client_status = 5; + google.protobuf.Empty uninstall = 6; + } +} + +message ClientStatus { + bool nginx_health = 2; +} + +message TableStatus { + string name = 1; + int64 last_sync = 2; + string hash = 3; +} + +message TaskResult { + string task_id = 1; + int32 status = 2; + string error = 3; +} + +message SyncTask { + oneof message { + MasterStatus pong = 1; + TableTask table = 2; + FileTask file = 3; + google.protobuf.Empty uninstall = 4; + google.protobuf.Empty reset = 5; + ClientSync clientSync = 6; + } +} + +message MasterStatus { + string version = 1; + bool nginx_health = 2; +} + +message ClientSync { + int64 last_sync = 1; + bool sync = 2; + string master_ver = 3; +} + +message TableTask { + string task_id = 1; + string task_name = 2; + string table_name = 3; + int64 from = 4; + int64 to = 5; + bytes data = 6; + bool full = 7; +} + +message FileTask { + string task_id = 1; + string task_name = 2; + string file_name = 3; + int64 site_id = 4; + bytes data = 5; +} diff --git a/extract/proto/proto/bridge.proto b/extract/proto/proto/bridge.proto new file mode 100644 index 0000000..153f1e1 --- /dev/null +++ b/extract/proto/proto/bridge.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; + +package chaitin.safeline_ops.proto.v1.bridge; + +import "google/protobuf/empty.proto"; + +service Bridge { + rpc Metadata(google.protobuf.Empty) returns (MetadataResp); + rpc LicenseCtrl(LicenseCtrlReq) returns (google.protobuf.Empty); +} + +message MetadataResp { + string version = 1; + string machine_id = 2; + LicenseKind license_kind = 3; +} + +message LicenseCtrlReq { + oneof action { + string apply = 1; + google.protobuf.Empty remove = 2; + } +} + +enum LicenseKind { + LICENSE_KIND_UNSPECIFIED = 0; + LICENSE_KIND_COMMUNITY = 1; + LICENSE_KIND_PRO = 2; + LICENSE_KIND_ENTERPRISE = 3; +} diff --git a/extract/proto/proto/server.proto b/extract/proto/proto/server.proto new file mode 100644 index 0000000..257ecb2 --- /dev/null +++ b/extract/proto/proto/server.proto @@ -0,0 +1,110 @@ +syntax = "proto3"; + +package chaitin.safeline_ops.proto.v1.server; + +import "google/protobuf/empty.proto"; + +service Server { + rpc Sync(stream SyncRequest) returns (stream SyncPush); + rpc IPInfo(IPInfoRequest) returns (IPInfoResponse); +} + +message ValidateCode { + string code = 1; + string machine_id = 2; + string version = 3; + string id = 4; +} + +message ChangeCode { + string new_code = 1; + string machine_id = 2; + string version = 3; + string id = 4; +} + +message GiveBackCode { + string code = 1; + string machine_id = 2; + string version = 3; + string id = 4; +} + +message ValidateResult { + ValidateCodeState state = 1; + int64 expired_at = 2; + string org_name = 3; + string org_id = 4; + string id = 5; + Edition edition = 6; +} + +message ChangeCodeResult { + ValidateCodeState state = 1; + int64 expired_at = 2; + string org_name = 3; + string org_id = 4; + string id = 5; + Edition edition = 6; +} + +message GiveBackCodeResult { + GiveBackCodeState state = 1; + string id = 2; +} + +message SyncRequest { + oneof message { + google.protobuf.Empty ping = 1; + ValidateCode validate_code = 2; + ChangeCode change_code = 3; + GiveBackCode giveback_code = 4; + } +} + +message SyncPush { + oneof message { + google.protobuf.Empty pong = 1; + ValidateResult validate_result = 2; + ChangeCodeResult change_code_result = 3; + GiveBackCodeResult giveback_code_result = 4; + } +} + +message IPInfoRequest { + +} + +message IPInfoResponse { + string ip = 1; + string country = 2; + string province = 3; + string city = 4; + string areacode = 5; + string timezone = 6; + string zipcode = 7; + string lngwgs = 8; + string latwgs = 9; + string isp = 10; + string owner = 11; + string adcode = 12; +} + +enum ValidateCodeState { + VALIDATE_CODE_STATE_SUCCESS = 0; + VALIDATE_CODE_STATE_EXPIRED = 1; + VALIDATE_CODE_STATE_INVALID = 2; + VALIDATE_CODE_STATE_USED = 3; + VALIDATE_CODE_STATE_CONNECTED = 4; +} + +enum Edition { + EDITION_UNKOWN = 0; + EDITION_PROFESSIONAL = 1; + EDITION_ENTERPRISE = 2; +} + +enum GiveBackCodeState { + GIVEBACK_CODE_STATE_SUCCESS = 0; + GIVEBACK_CODE_STATE_FAILED = 1; +} diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..ed708a8 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,12 @@ +[project] +name = "safeline" +version = "0.1.0" +description = "Add your description here" +readme = "README.md" +requires-python = ">=3.11.3" +dependencies = [] + +[dependency-groups] +dev = [ + "protobuf>=6.30.0", +] diff --git a/replace.py b/replace.py new file mode 100644 index 0000000..0e0fccc --- /dev/null +++ b/replace.py @@ -0,0 +1,16 @@ +from sys import argv + +public_key = b"""safeline-cloud.chaitin.com:50052""" + +new_public_key = b"""crack-domain-length-is--26:50052""" + + +with open(argv[1], "rb") as f: + data = f.read() + +assert public_key in data + +assert len(public_key) == len(new_public_key) + +with open(argv[1], "wb") as f: + f.write(data.replace(public_key, new_public_key)) diff --git a/uv.lock b/uv.lock new file mode 100644 index 0000000..4919936 --- /dev/null +++ b/uv.lock @@ -0,0 +1,31 @@ +version = 1 +requires-python = ">=3.11.3" + +[[package]] +name = "protobuf" +version = "6.30.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/53/6a/2629bb3529e5bdfbd6c4608ff5c7d942cd4beae85793f84ba543aab2548a/protobuf-6.30.0.tar.gz", hash = "sha256:852b675d276a7d028f660da075af1841c768618f76b90af771a8e2c29e6f5965", size = 429239 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/aa/76/8b1cbf762d98b09fcb29bbc6eca97dc6e1cd865b97a49c443aa23f1a9f82/protobuf-6.30.0-cp310-abi3-win32.whl", hash = "sha256:7337d76d8efe65ee09ee566b47b5914c517190196f414e5418fa236dfd1aed3e", size = 419141 }, + { url = "https://files.pythonhosted.org/packages/57/50/2ea2fb4533321438f5106723c70c303529ba184540e619ebe75e790d402e/protobuf-6.30.0-cp310-abi3-win_amd64.whl", hash = "sha256:9b33d51cc95a7ec4f407004c8b744330b6911a37a782e2629c67e1e8ac41318f", size = 430995 }, + { url = "https://files.pythonhosted.org/packages/a1/7d/a7dfa7aa3deda114920b1ed57c0026e85a976e74658db2784a0443510252/protobuf-6.30.0-cp39-abi3-macosx_10_9_universal2.whl", hash = "sha256:52d4bb6fe76005860e1d0b8bfa126f5c97c19cc82704961f60718f50be16942d", size = 417570 }, + { url = "https://files.pythonhosted.org/packages/11/87/a9c7b020c4072dc34e3a2a3cde69366ffc623afff0e7f10f4e5275aaec01/protobuf-6.30.0-cp39-abi3-manylinux2014_aarch64.whl", hash = "sha256:7940ab4dfd60d514b2e1d3161549ea7aed5be37d53bafde16001ac470a3e202b", size = 317310 }, + { url = "https://files.pythonhosted.org/packages/95/66/424db2262723781dc94208ff9ce201df2f44f18a46fbff3c067812c6b5b9/protobuf-6.30.0-cp39-abi3-manylinux2014_x86_64.whl", hash = "sha256:d79bf6a202a536b192b7e8d295d7eece0c86fbd9b583d147faf8cfeff46bf598", size = 316203 }, + { url = "https://files.pythonhosted.org/packages/51/6f/21c2b7de96c3051f847a4a88a12fdf015ed6b7d50fc131fb101a739bd7a5/protobuf-6.30.0-py3-none-any.whl", hash = "sha256:e5ef216ea061b262b8994cb6b7d6637a4fb27b3fb4d8e216a6040c0b93bd10d7", size = 167054 }, +] + +[[package]] +name = "safeline" +version = "0.1.0" +source = { virtual = "." } + +[package.dev-dependencies] +dev = [ + { name = "protobuf" }, +] + +[package.metadata] + +[package.metadata.requires-dev] +dev = [{ name = "protobuf", specifier = ">=6.30.0" }]