gcw 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. gcw-0.1.0/.github/ISSUE_TEMPLATE/bug.md +21 -0
  2. gcw-0.1.0/.github/ISSUE_TEMPLATE/config.yml +1 -0
  3. gcw-0.1.0/.github/ISSUE_TEMPLATE/feature.md +23 -0
  4. gcw-0.1.0/.github/ISSUE_TEMPLATE/idea.md +17 -0
  5. gcw-0.1.0/.github/pull_request_template.md +10 -0
  6. gcw-0.1.0/.github/workflows/ci.yml +37 -0
  7. gcw-0.1.0/.github/workflows/release.yml +46 -0
  8. gcw-0.1.0/.gitignore +11 -0
  9. gcw-0.1.0/AGENTS.md +56 -0
  10. gcw-0.1.0/CHANGELOG.md +21 -0
  11. gcw-0.1.0/LICENSE +202 -0
  12. gcw-0.1.0/PKG-INFO +206 -0
  13. gcw-0.1.0/README.md +182 -0
  14. gcw-0.1.0/docs/adr/0001-record-architecture-decisions.md +16 -0
  15. gcw-0.1.0/docs/adr/0002-python-stdlib-only.md +18 -0
  16. gcw-0.1.0/docs/adr/0003-src-layout-uv.md +16 -0
  17. gcw-0.1.0/docs/adr/0004-navigation-only.md +16 -0
  18. gcw-0.1.0/docs/adr/0005-context-from-gcloud-config.md +18 -0
  19. gcw-0.1.0/docs/adr/0006-cache-never-blocks-completion.md +20 -0
  20. gcw-0.1.0/docs/adr/0007-reuse-gcloud-auth.md +18 -0
  21. gcw-0.1.0/docs/adr/0008-per-service-list-no-asset-inventory.md +16 -0
  22. gcw-0.1.0/docs/adr/0009-gcloud-web-shell-wrapper.md +16 -0
  23. gcw-0.1.0/docs/adr/0010-routes-as-data.md +22 -0
  24. gcw-0.1.0/docs/adr/0011-project-structure.md +31 -0
  25. gcw-0.1.0/docs/adr/0012-cli-syntax-and-routes.md +58 -0
  26. gcw-0.1.0/docs/adr/0013-supported-platforms.md +31 -0
  27. gcw-0.1.0/docs/adr/0014-docs-in-repo.md +24 -0
  28. gcw-0.1.0/docs/adr/0015-no-gcloud-shell-wrapper.md +30 -0
  29. gcw-0.1.0/docs/adr/0016-official-token-command-by-default.md +27 -0
  30. gcw-0.1.0/docs/adr/0017-plan-checklists-until-issues.md +23 -0
  31. gcw-0.1.0/docs/adr/0018-cache-commands.md +32 -0
  32. gcw-0.1.0/docs/adr/0019-service-names-follow-gcloud.md +22 -0
  33. gcw-0.1.0/docs/adr/0020-gcloud-syntax-input.md +70 -0
  34. gcw-0.1.0/docs/adr/0021-open-work-in-github-issues.md +35 -0
  35. gcw-0.1.0/docs/adr/0022-tab-budget-100ms.md +22 -0
  36. gcw-0.1.0/docs/adr/0023-no-token-database-opt-in.md +30 -0
  37. gcw-0.1.0/docs/adr/0024-opt-in-gcloud-web-function.md +29 -0
  38. gcw-0.1.0/docs/adr/0025-release-process.md +29 -0
  39. gcw-0.1.0/docs/adr/README.md +31 -0
  40. gcw-0.1.0/docs/adr/template.md +16 -0
  41. gcw-0.1.0/docs/architecture.md +99 -0
  42. gcw-0.1.0/docs/plan.md +39 -0
  43. gcw-0.1.0/pyproject.toml +42 -0
  44. gcw-0.1.0/src/gcw/__init__.py +12 -0
  45. gcw-0.1.0/src/gcw/__main__.py +7 -0
  46. gcw-0.1.0/src/gcw/api/__init__.py +6 -0
  47. gcw-0.1.0/src/gcw/api/auth.py +62 -0
  48. gcw-0.1.0/src/gcw/api/client.py +189 -0
  49. gcw-0.1.0/src/gcw/cache/__init__.py +6 -0
  50. gcw-0.1.0/src/gcw/cache/refresh.py +104 -0
  51. gcw-0.1.0/src/gcw/cache/store.py +134 -0
  52. gcw-0.1.0/src/gcw/cli/__init__.py +4 -0
  53. gcw-0.1.0/src/gcw/cli/complete.py +209 -0
  54. gcw-0.1.0/src/gcw/cli/gcloud_syntax.py +153 -0
  55. gcw-0.1.0/src/gcw/cli/lookup.py +121 -0
  56. gcw-0.1.0/src/gcw/cli/main.py +591 -0
  57. gcw-0.1.0/src/gcw/cli/pager.py +94 -0
  58. gcw-0.1.0/src/gcw/cli/resources.py +107 -0
  59. gcw-0.1.0/src/gcw/cli/shell/gcw.bash +85 -0
  60. gcw-0.1.0/src/gcw/cli/shell/gcw.fish +7 -0
  61. gcw-0.1.0/src/gcw/cli/shell/gcw.zsh +25 -0
  62. gcw-0.1.0/src/gcw/cli/shell/web-flag.fish +14 -0
  63. gcw-0.1.0/src/gcw/cli/shell/web-flag.sh +17 -0
  64. gcw-0.1.0/src/gcw/context/__init__.py +7 -0
  65. gcw-0.1.0/src/gcw/context/gcloud_config.py +178 -0
  66. gcw-0.1.0/src/gcw/context/resolve.py +43 -0
  67. gcw-0.1.0/src/gcw/services/__init__.py +70 -0
  68. gcw-0.1.0/src/gcw/services/artifacts.py +51 -0
  69. gcw-0.1.0/src/gcw/services/composer.py +57 -0
  70. gcw-0.1.0/src/gcw/services/compute.py +48 -0
  71. gcw-0.1.0/src/gcw/services/container.py +42 -0
  72. gcw-0.1.0/src/gcw/services/dataproc.py +84 -0
  73. gcw-0.1.0/src/gcw/services/functions.py +39 -0
  74. gcw-0.1.0/src/gcw/services/iam.py +36 -0
  75. gcw-0.1.0/src/gcw/services/landing.py +99 -0
  76. gcw-0.1.0/src/gcw/services/run.py +60 -0
  77. gcw-0.1.0/src/gcw/services/secrets.py +39 -0
  78. gcw-0.1.0/src/gcw/services/sql.py +38 -0
  79. gcw-0.1.0/src/gcw/services/storage.py +40 -0
  80. gcw-0.1.0/src/gcw/web/__init__.py +4 -0
  81. gcw-0.1.0/src/gcw/web/browser.py +57 -0
  82. gcw-0.1.0/src/gcw/web/route.py +124 -0
  83. gcw-0.1.0/src/gcw/web/url.py +35 -0
  84. gcw-0.1.0/tests/conftest.py +73 -0
  85. gcw-0.1.0/tests/test_api.py +195 -0
  86. gcw-0.1.0/tests/test_browser.py +129 -0
  87. gcw-0.1.0/tests/test_cache.py +278 -0
  88. gcw-0.1.0/tests/test_cli.py +231 -0
  89. gcw-0.1.0/tests/test_complete.py +190 -0
  90. gcw-0.1.0/tests/test_env.py +48 -0
  91. gcw-0.1.0/tests/test_gcloud_command.py +78 -0
  92. gcw-0.1.0/tests/test_gcloud_config.py +133 -0
  93. gcw-0.1.0/tests/test_gcloud_syntax.py +86 -0
  94. gcw-0.1.0/tests/test_landing.py +120 -0
  95. gcw-0.1.0/tests/test_listing.py +209 -0
  96. gcw-0.1.0/tests/test_lookup.py +172 -0
  97. gcw-0.1.0/tests/test_pager.py +152 -0
  98. gcw-0.1.0/tests/test_route.py +61 -0
  99. gcw-0.1.0/tests/test_services.py +107 -0
  100. gcw-0.1.0/tests/test_url.py +45 -0
  101. gcw-0.1.0/tests/test_web_flag.py +106 -0
  102. gcw-0.1.0/uv.lock +79 -0
@@ -0,0 +1,21 @@
1
+ ---
2
+ name: Bug
3
+ about: Something in gcw does not work as described
4
+ labels: bug
5
+ ---
6
+
7
+ ## What happened
8
+
9
+ The command you ran and what it did. For a wrong page, add the URL from the same command with `-n`; it never contains your email address.
10
+
11
+ ```
12
+ $ gcw …
13
+ ```
14
+
15
+ ## What you expected
16
+
17
+ ## Environment
18
+
19
+ - `gcw --version`:
20
+ - `gcloud --version` (first line):
21
+ - OS and shell (e.g. Ubuntu 24.04, bash; macOS, zsh; Windows, Git Bash):
@@ -0,0 +1 @@
1
+ blank_issues_enabled: true
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: Feature
3
+ about: Planned work on gcw, with tasks to tick
4
+ labels: enhancement
5
+ ---
6
+
7
+ ## Context
8
+
9
+ Why this is needed. Link related ADRs and issues.
10
+
11
+ ## Plan
12
+
13
+ How it should work: commands and their behaviour, examples.
14
+
15
+ ## Tasks
16
+
17
+ - [ ] …
18
+ - [ ] Tests (no network, no real gcloud configuration)
19
+ - [ ] README and docs, if behaviour changes
20
+
21
+ ## Done when
22
+
23
+ A check anyone can run, e.g. a command and what it prints or opens.
@@ -0,0 +1,17 @@
1
+ ---
2
+ name: Idea
3
+ about: A proposal worth considering, not planned yet
4
+ labels: idea
5
+ ---
6
+
7
+ ## Context
8
+
9
+ What problem or situation this is about.
10
+
11
+ ## Proposal
12
+
13
+ What gcw could do about it.
14
+
15
+ ## Open questions
16
+
17
+ What would have to be decided before it becomes planned work.
@@ -0,0 +1,10 @@
1
+ Closes #
2
+
3
+ ## What changed
4
+
5
+ ## Why
6
+
7
+ ## Verification
8
+
9
+ - `uv run pytest`:
10
+ - By hand:
@@ -0,0 +1,37 @@
1
+ name: CI
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches: [master]
7
+
8
+ jobs:
9
+ pytest:
10
+ name: pytest (${{ matrix.os }}, Python ${{ matrix.python }})
11
+ strategy:
12
+ fail-fast: false
13
+ # Platform differences and Python-version differences are independent:
14
+ # the oldest supported Python runs on every OS, the newest on Linux only.
15
+ matrix:
16
+ os: [ubuntu-latest, macos-latest, windows-latest]
17
+ python: ["3.11"]
18
+ include:
19
+ - os: ubuntu-latest
20
+ python: "3.13"
21
+ runs-on: ${{ matrix.os }}
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+ - uses: astral-sh/setup-uv@v6
25
+ with:
26
+ python-version: ${{ matrix.python }}
27
+ - run: uv sync
28
+ - run: uv run pytest
29
+
30
+ # Single required status check for branch protection: green only if every
31
+ # job above passed. New checks (lint, etc.) are added to `needs`.
32
+ ci:
33
+ if: always()
34
+ needs: [pytest]
35
+ runs-on: ubuntu-latest
36
+ steps:
37
+ - run: test "${{ needs.pytest.result }}" = success
@@ -0,0 +1,46 @@
1
+ name: Release
2
+
3
+ # Publishes gcw to PyPI when a tag vX.Y.Z is pushed (ADR-0025).
4
+ on:
5
+ push:
6
+ tags: ["v*"]
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ build:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ - uses: astral-sh/setup-uv@v6
17
+ # The version lives in pyproject.toml; the tag must match it.
18
+ - name: Check that the tag matches the project version
19
+ run: |
20
+ version="$(uv version --short)"
21
+ if [ "${GITHUB_REF_NAME#v}" != "$version" ]; then
22
+ echo "::error::tag $GITHUB_REF_NAME does not match version $version in pyproject.toml"
23
+ exit 1
24
+ fi
25
+ - run: uv build
26
+ - uses: actions/upload-artifact@v4
27
+ with:
28
+ name: dist
29
+ path: dist/
30
+
31
+ # Only this job can publish: it builds nothing, gets the OIDC token that
32
+ # PyPI Trusted Publishing checks, and waits for approval in `pypi`.
33
+ publish:
34
+ needs: [build]
35
+ runs-on: ubuntu-latest
36
+ environment:
37
+ name: pypi
38
+ url: https://pypi.org/project/gcw/
39
+ permissions:
40
+ id-token: write
41
+ steps:
42
+ - uses: actions/download-artifact@v4
43
+ with:
44
+ name: dist
45
+ path: dist/
46
+ - uses: pypa/gh-action-pypi-publish@release/v1
gcw-0.1.0/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .venv/
4
+ build/
5
+ dist/
6
+ *.egg-info/
7
+ .pytest_cache/
8
+ .coverage
9
+ htmlcov/
10
+
11
+ CLAUDE.md
gcw-0.1.0/AGENTS.md ADDED
@@ -0,0 +1,56 @@
1
+ # AGENTS.md
2
+
3
+ Instructions for AI agents (Claude Code, Codex, etc.) working in this repository.
4
+
5
+ ## Project
6
+
7
+ `gcw` ("gcloud web"): a `gh browse`-style CLI that opens Google Cloud services and resources in the browser, taking context from the gcloud configuration and offering instant TAB completion of resource names.
8
+
9
+ - Open work: GitHub issues (`gh issue list`). A milestone is a release; `enhancement` is planned work, `idea` a proposal, `bug` a defect ([ADR-0021](docs/adr/0021-open-work-in-github-issues.md)).
10
+ - Direction: [docs/plan.md](docs/plan.md). How gcw works: [docs/architecture.md](docs/architecture.md). Docs carry no status: never add checklists or "done" markers to them; progress is visible only in issues, milestones and merged pull requests.
11
+ - Decisions: [docs/adr/](docs/adr/). A new decision is a new ADR plus a row in [docs/adr/README.md](docs/adr/README.md), committed with the code it concerns.
12
+ - `docs/` is committed and written in English ([ADR-0014](docs/adr/0014-docs-in-repo.md)). The only exception is `docs/research.md`, a local Polish notebook excluded via `.git/info/exclude`; never commit it.
13
+
14
+ ## Rules that require a new ADR to break
15
+
16
+ - **Runtime uses the standard library only.** Third-party packages are allowed in the dev group only (pytest, etc.).
17
+ - **gcw navigates, gcloud operates.** No commands that change the state of cloud resources.
18
+ - **The completion path (`gcw __complete`) never touches the network or spawns subprocesses**; it reads the cache only. Budget: < 100 ms ([ADR-0022](docs/adr/0022-tab-budget-100ms.md)). Do not add slow top-level imports; import lazily inside functions that are not on the completion path.
19
+ - **URL routes are data, not logic.** Adding a service is primarily a registry entry, and every URL template must be verified against the real console.
20
+ - **Do not import gcloud's code.** Read gcloud's files only where an ADR allows it: its INI configuration. Never read its credential files ([ADR-0023](docs/adr/0023-no-token-database-opt-in.md)); tokens come from `gcloud auth print-access-token`.
21
+
22
+ ## Stack and commands
23
+
24
+ - Python >= 3.11 (`tomllib`), uv, `src/` layout.
25
+ - `uv sync` to set up the environment, `uv run pytest` to run tests, `uv run gcw …` to run the CLI.
26
+ - Tests must not use the network or the real `~/.config/gcloud`. Use a fake `CLOUDSDK_CONFIG` under `tmp_path`.
27
+
28
+ ## Workflow
29
+
30
+ - **The user reviews every edit and wants to understand it.** For every file change, briefly explain (in Polish, in the chat) what you are changing, why, and how it connects to the rest of the code. Avoid large unexplained changes; split work into steps that can be read and understood one at a time.
31
+ - **Work starts from an issue.** Read it first (`gh issue view N`); its Tasks and Done when are the scope. A pull request that finishes it says `Closes #N` in its description.
32
+ - **Keep the issue in sync with the work.** When a decision changes the scope, propose a ready-to-paste `gh issue edit` that updates its Tasks. Before the pull request, propose ticking the finished tasks; anything done differently from the issue goes into a closing comment on the issue and into the PR description. Work that belongs to another issue (or to none) gets its own task there, or a new issue.
33
+ - **New work becomes an issue, not a note in the docs.** Propose it as a ready-to-paste `gh issue create` command following the templates in `.github/ISSUE_TEMPLATE/` (feature: Context, Plan, Tasks, Done when; idea: Context, Proposal, Open questions).
34
+ - **Docs change together with the code.** A pull request that changes behaviour updates `README.md` and `docs/architecture.md`; one that makes a decision adds an ADR. `docs/plan.md` changes only when the direction changes.
35
+ - **Everything committed is in English**: code, identifiers, docstrings, comments, CLI messages, commit messages, docs, this file. Only the local `docs/research.md` stays in Polish.
36
+
37
+ ## Commits and pull requests
38
+
39
+ - **Every change goes through a pull request into `master`**; never commit directly to `master`. Work on a branch named `<type>/<short-description>` (e.g. `feat/gcloud-config`).
40
+ - **The user runs git and gh, not the agent.** Never run `git add`, `git commit`, `git push`, branch-switching commands or `gh pr create` yourself. Instead, propose in the chat the ready-to-paste commands together with the commit message and the PR title/description, so the user can adjust them before running.
41
+ - Format: [Conventional Commits](https://www.conventionalcommits.org/), `type: description` or `type(scope): description`.
42
+ - Types: `feat`, `fix`, `refactor`, `perf`, `test`, `docs`, `build` (packaging, dependencies, uv), `ci`, `chore`.
43
+ - Scope is optional. Use it only when it adds information: a layer (`cli`, `context`, `cache`, `api`, `web`, `services`) or a GCP service (`run`, `sql`, …). Omit it for cross-cutting changes; never force one.
44
+ - Description: imperative mood, lowercase, no trailing period, about 72 characters max. Mark breaking changes with `!` (e.g. `feat(cli)!: …`).
45
+ - No AI attribution: do not add `Co-Authored-By` or "Generated with" lines to commit messages or PR descriptions.
46
+ - The PR title uses the same format, because it becomes the commit message on squash merge. The PR description explains what changed and why, and how it was verified.
47
+
48
+ ## ADRs
49
+
50
+ - A significant decision (a dependency, a data format, user-visible behavior, an exception to the rules above) requires a new `docs/adr/NNNN-short-title.md` based on the [template](docs/adr/template.md).
51
+ - Do not rewrite accepted ADRs. Record a new decision as a new ADR with `Status: Accepted, supersedes NNNN`, and set `Superseded by NNNN` in the old one.
52
+
53
+ ## Conventions
54
+
55
+ - **English docstrings are mandatory** for every module (what it does and what it is responsible for), class, function and method, including service modules (which GCP service it covers: routes, tabs, where the resource list comes from). Style: a one-line summary; for non-trivial logic, add a description, arguments and the return value.
56
+ - Inline comments only where the code does not speak for itself.
gcw-0.1.0/CHANGELOG.md ADDED
@@ -0,0 +1,21 @@
1
+ # Changelog
2
+
3
+ All notable changes to gcw are recorded here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow [ADR-0025](docs/adr/0025-release-process.md): 0.x while gcw is a prototype, a breaking change bumps the minor version.
4
+
5
+ ## [0.1.0] - 2026-11-06
6
+
7
+ First release. Console URL templates were checked by hand against the real console, except the resource pages of Cloud Functions and Composer ([#35](https://github.com/terleckimaciej/gcloud-web/issues/35)).
8
+
9
+ ### Added
10
+
11
+ - Open Google Cloud console pages from the terminal with gcloud's words: `gcw` (project dashboard), `gcw SERVICE`, `gcw SERVICE KIND`, `gcw SERVICE KIND NAME [--tab TAB]`, and `gcw open PATH` for any console path.
12
+ - Resource pages for Cloud Run, Cloud SQL, Cloud Storage, Compute Engine, GKE, Cloud Functions, Secret Manager, Artifact Registry, IAM service accounts, Dataproc and Composer (including its Airflow UI), and start pages of about 50 more services; `gcw services` prints the map.
13
+ - Context from gcloud's configuration: account, project and default regions, with `-p/--project`, `-c/--configuration` and `-l/--location` to override them for one command.
14
+ - A local cache of resource names and locations, filled from each service's read-only REST `list` API and refreshed in the background; `gcw cache list` and `gcw cache refresh`.
15
+ - TAB completion of commands, kinds, resource names and tabs from the cache in bash, zsh and fish: `gcw completion SHELL [--install]`.
16
+ - gcloud command syntax as input: `gcw gcloud GCLOUD_ARGS...`, and an opt-in `gcloud … --web` shell function from `gcw web-flag SHELL [--install]`.
17
+ - `gcw env CONFIGURATION` to use another gcloud configuration in one shell.
18
+ - `-n/--no-browser` to print the URL instead of opening it, and `--no-authuser`.
19
+ - Linux, macOS and Windows; no runtime dependencies besides Python 3.11+ and gcloud.
20
+
21
+ [0.1.0]: https://github.com/terleckimaciej/gcloud-web/releases/tag/v0.1.0
gcw-0.1.0/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.