codecraftai-restclient-tailscale 1.2.0__tar.gz → 1.2.2__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.
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/LICENSE.md +30 -21
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/PKG-INFO +5 -5
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/pyproject.toml +5 -24
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/_codegen/emitter.py +33 -6
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/apigroups/aclsgroup.py +5 -3
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/apigroups/devicesgroup.py +9 -7
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/apigroups/dnsgroup.py +5 -3
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/apigroups/groupsupport.py +29 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/apigroups/keysgroup.py +9 -5
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/apigroups/posturegroup.py +5 -4
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/apigroups/tailnetsgroup.py +5 -3
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/oauthbearer.py +9 -3
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/tailscaleclient.py +4 -2
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/README.rst +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/__init__.py +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/_codegen/__init__.py +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/_codegen/import_openapi.py +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/_codegen/typemap.py +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/_spec/.gitkeep +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/_spec/openapi.json +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/_spec/openapi.sha256 +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/apigroups/__init__.py +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/aspectstailscale.py +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/exceptions.py +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/model/__init__.py +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/model/tailscaleawsexternalid.py +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/model/tailscaleconfigurationauditlog.py +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/model/tailscaleconnectioncounts.py +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/model/tailscalecontact.py +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/model/tailscaledevice.py +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/model/tailscaledeviceinvite.py +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/model/tailscaledevicepostureattributes.py +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/model/tailscaledeviceroutes.py +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/model/tailscalednsconfiguration.py +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/model/tailscalednsconfigurationpreferences.py +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/model/tailscalednsconfigurationresolver.py +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/model/tailscalednspreferences.py +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/model/tailscalednssearchpaths.py +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/model/tailscaleerror.py +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/model/tailscalekey.py +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/model/tailscalekeycapabilities.py +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/model/tailscalelogstreamendpointconfiguration.py +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/model/tailscalelogstreamendpointpublishingstatus.py +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/model/tailscalenetworkflowlog.py +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/model/tailscalepostureintegration.py +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/model/tailscaleservicehostinfo.py +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/model/tailscalesplitdns.py +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/model/tailscaletailnetsettings.py +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/model/tailscaleuser.py +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/model/tailscaleuserinvite.py +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/model/tailscalevipserviceapproval.py +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/model/tailscalevipserviceinfo.py +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/model/tailscalevipserviceinfoput.py +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/model/tailscalewebhook.py +0 -0
- {codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/source/packages/ccai/restclient/tailscale/py.typed +0 -0
{codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/LICENSE.md
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Code Craft AI - Source Available License
|
|
2
|
-
Version 1.
|
|
2
|
+
Version 1.1, November 2026
|
|
3
3
|
|
|
4
4
|
Copyright (C) 2026, Code Craft AI LLC
|
|
5
5
|
|
|
@@ -7,12 +7,12 @@ Everyone is permitted to copy and distribute verbatim copies of *This License* d
|
|
|
7
7
|
|
|
8
8
|
*This License* covers the Python Automation Kit, the full suite of software published by *Licensor* that consists of every `codecraftai-*` package, every `pychestrate` package, and the `pychestrate` server.
|
|
9
9
|
|
|
10
|
-
*The Software* is source available. Its source code is published so that anyone can read it, learn from it, and use it, but *This License* is not an open source license. *The Software* is free to use for *Non-Commercial Use*. *Commercial Use* is permitted in exchange for a *Usage Fee* that is based on a reasonable estimation of the income derived from *The Software*, as described in section 5. When a company migrates a product or service to *The Software* from another code base, the *
|
|
10
|
+
*The Software* is source available. Its source code is published so that anyone can read it, learn from it, and use it, but *This License* is not an open source license. *The Software* is free to use for *Non-Commercial Use*. *Commercial Use* is permitted in exchange for a *Usage Fee* that is based on a reasonable estimation of the income derived from *The Software*, as described in section 5. That estimation starts from *Gross Income*, not net profit, so spending on research and development or other operating expenses does not reduce it. When a company migrates a product or service to *The Software* from another code base, the *Gross Income* from that product or service is not counted toward the *Usage Fee* for two years, as described in section 5.4. For assurance of costs, a company can disclose its usage and estimated returns to *Licensor* and negotiate a fixed license cost, as described in section 5.10.
|
|
11
11
|
|
|
12
12
|
## 1. Definitions
|
|
13
13
|
|
|
14
14
|
### 1.1 *This License* or *The License*
|
|
15
|
-
**This License** or **The License** refers to version 1.
|
|
15
|
+
**This License** or **The License** refers to version 1.1 of the Code Craft AI - Source Available License.
|
|
16
16
|
|
|
17
17
|
### 1.2 Licensor
|
|
18
18
|
**Licensor** refers to Code Craft AI LLC.
|
|
@@ -42,14 +42,14 @@ Everyone is permitted to copy and distribute verbatim copies of *This License* d
|
|
|
42
42
|
### 1.9 Fiscal Year
|
|
43
43
|
**Fiscal Year** means the annual accounting period that *You* use for financial reporting.
|
|
44
44
|
|
|
45
|
-
### 1.10
|
|
46
|
-
**
|
|
45
|
+
### 1.10 Gross Income
|
|
46
|
+
**Gross Income** means, for each product or service in connection with which *You* make *Commercial Use* of *The Software*, the gross profit that *You* earn from that product or service during a *Fiscal Year*: the revenue from that product or service, less its cost of goods sold or cost of revenue, determined under the accounting principles that *You* regularly use for financial reporting. *Gross Income* is calculated before operating expenses, such as research and development, sales and marketing, and general and administrative expenses, and before interest and taxes. *Gross Income* is measured for the products and services that *The Software* is used for, not for *Your* business as a whole.
|
|
47
47
|
|
|
48
48
|
### 1.11 Contribution Estimate
|
|
49
|
-
**Contribution Estimate** means *Your* reasonable, good faith estimate of the portion of the *
|
|
49
|
+
**Contribution Estimate** means *Your* reasonable, good faith estimate of the portion of the *Gross Income* that *The Software* contributed to, expressed as a number from 0 to 1.
|
|
50
50
|
|
|
51
51
|
### 1.12 Derived Income
|
|
52
|
-
**Derived Income** means the portion of the *
|
|
52
|
+
**Derived Income** means the portion of the *Gross Income* for a *Fiscal Year* that is derived from *The Software*, calculated as described in section 5.2.
|
|
53
53
|
|
|
54
54
|
### 1.13 Usage Fee
|
|
55
55
|
**Usage Fee** means the yearly fee for *Commercial Use* that is set by the table in section 5.3.
|
|
@@ -58,7 +58,7 @@ Everyone is permitted to copy and distribute verbatim copies of *This License* d
|
|
|
58
58
|
**Migration** means moving the work for one of *Your* products or services from a code base other than *The Software*, such as another framework, another library, or *Your* own code, to *The Software*.
|
|
59
59
|
|
|
60
60
|
### 1.15 Migration Period
|
|
61
|
-
**Migration Period** means the two (2) year period, described in section 5.4, during which the *
|
|
61
|
+
**Migration Period** means the two (2) year period, described in section 5.4, during which the *Gross Income* from a product or service that *You* are migrating to *The Software* is not counted.
|
|
62
62
|
|
|
63
63
|
## 2. License Grant
|
|
64
64
|
|
|
@@ -96,11 +96,11 @@ For each *Fiscal Year* in which *You* make *Commercial Use* of *The Software*, *
|
|
|
96
96
|
### 5.2 Derived Income
|
|
97
97
|
The *Derived Income* for a *Fiscal Year* is calculated as follows:
|
|
98
98
|
|
|
99
|
-
(Contribution Estimate) * (
|
|
99
|
+
(Contribution Estimate) * (Gross Income) = (Derived Income)
|
|
100
100
|
|
|
101
|
-
If *You* make *Commercial Use* of *The Software* for more than one product or service, calculate the *Derived Income* for each product or service using its own *Contribution Estimate* and *
|
|
101
|
+
If *You* make *Commercial Use* of *The Software* for more than one product or service, calculate the *Derived Income* for each product or service using its own *Contribution Estimate* and *Gross Income*, and add the results together. The *Gross Income* from a product or service that is in its *Migration Period* is not counted, as described in section 5.4.
|
|
102
102
|
|
|
103
|
-
If the *
|
|
103
|
+
If the *Gross Income* from a product or service for a *Fiscal Year* is zero or less, then the *Derived Income* from that product or service for that *Fiscal Year* is zero.
|
|
104
104
|
|
|
105
105
|
### 5.3 Usage Fee
|
|
106
106
|
The *Usage Fee* for a *Fiscal Year* is set by the *Derived Income* for that *Fiscal Year*, as shown in the following table.
|
|
@@ -113,56 +113,65 @@ The *Usage Fee* for a *Fiscal Year* is set by the *Derived Income* for that *Fis
|
|
|
113
113
|
| More than 100,000,000, up to and including 1,000,000,000 | 250,000 |
|
|
114
114
|
| More than 1,000,000,000 | 500,000 |
|
|
115
115
|
|
|
116
|
-
All amounts in this section 5 are in United States dollars. If *You* report *
|
|
116
|
+
All amounts in this section 5 are in United States dollars. If *You* report *Gross Income* in a different currency, convert the *Derived Income* to United States dollars using the average exchange rate for the *Fiscal Year*.
|
|
117
117
|
|
|
118
118
|
### 5.4 Migration Allowance
|
|
119
|
-
When *You* migrate a product or service to *The Software*, the *
|
|
119
|
+
When *You* migrate a product or service to *The Software*, the *Gross Income* from that product or service is not counted when calculating the *Derived Income* during its *Migration Period* (the **Migration Allowance**).
|
|
120
120
|
|
|
121
121
|
The *Migration Period* for a product or service begins on the date that *You* first make *Commercial Use* of *The Software* for that product or service as part of its *Migration*, and ends two (2) years after that date.
|
|
122
122
|
|
|
123
123
|
The *Migration Allowance* applies to each product or service separately, and *You* may use it for every product or service that *You* migrate. Each product or service has only one *Migration Period*.
|
|
124
124
|
|
|
125
|
-
If a *Fiscal Year* is only partly within the *Migration Period* of a product or service, the *
|
|
125
|
+
If a *Fiscal Year* is only partly within the *Migration Period* of a product or service, the *Gross Income* from that product or service for that *Fiscal Year* is reduced in proportion to the number of days of that *Fiscal Year* that fall within its *Migration Period*.
|
|
126
126
|
|
|
127
|
-
For example, a company tests product A with *The Software* and pays a *Usage Fee* based on the *
|
|
127
|
+
For example, a company tests product A with *The Software* and pays a *Usage Fee* based on the *Gross Income* from product A. On March 1, 2027, the company begins moving the testing of product B from a different test framework to *The Software*. The company does not count the *Gross Income* from product B in its *Derived Income* from March 1, 2027 until March 1, 2029. Starting March 1, 2029, the *Gross Income* from product B is counted. If the company later migrates product C, the *Gross Income* from product C is not counted for two years from the start of its own *Migration*.
|
|
128
128
|
|
|
129
129
|
### 5.5 Contribution Estimate
|
|
130
130
|
*You* are responsible for making the *Contribution Estimate*. A *Contribution Estimate* must be reasonable and made in good faith. The *Contribution Estimate* for a product or service covers all of the *Components* that *You* *Use* for that product or service. When making the *Contribution Estimate*, *You* should consider how important *The Software* is to the *Commercial Activity*, how much of the *Commercial Activity* depends on *The Software*, and the effort and cost that *You* would otherwise need to spend to accomplish what *The Software* accomplishes for *You*.
|
|
131
131
|
|
|
132
132
|
The following table is a guide for making the *Contribution Estimate*. When *Your* *Commercial Use* of *The Software* matches an entry in the table, the *Contribution Estimate* in that entry is a reasonable *Contribution Estimate*. When *Your* *Commercial Use* does not match an entry in the table, make the *Contribution Estimate* by comparing *Your* *Commercial Use* with the entries in the table. When more than one entry matches the same *Commercial Activity*, use the entry with the highest *Contribution Estimate*.
|
|
133
133
|
|
|
134
|
+
Many products are not software, such as devices, machines, vehicles, and other physical goods, and software accounts for only part of what such a product is worth. For a product or service that is not software, *You* may reduce the *Contribution Estimate* in proportion to the share of the value of the shipped product that its software reasonably accounts for. To do so, multiply the *Contribution Estimate* from the table by that share, expressed as a number from 0 to 1. *You* must keep records that reasonably support that share, as described in section 5.8.
|
|
135
|
+
|
|
134
136
|
| Commercial Use of *The Software* | Contribution Estimate |
|
|
135
137
|
|----------------------------------|-----------------------|
|
|
136
138
|
| Quality Assurance (QA) and Continuous Integration (CI): *The Software* is used to test or validate the products or services of the *Commercial Activity*, or to run their build and test pipelines | 0.3 |
|
|
137
139
|
| Products Completely Based on *The Software*: the products or services of the *Commercial Activity* are built completely on *The Software* | 0.5 |
|
|
138
140
|
|
|
139
141
|
### 5.6 Examples
|
|
140
|
-
A company earns 1,000,000,000 in *
|
|
142
|
+
A company earns 1,000,000,000 in *Gross Income* from a product line during a *Fiscal Year*. The company uses *The Software* for the QA and CI of that product line, so the *Contribution Estimate* is 0.3.
|
|
141
143
|
|
|
142
144
|
0.3 * 1,000,000,000 = 300,000,000
|
|
143
145
|
|
|
144
146
|
The *Derived Income* of 300,000,000 is more than 100,000,000 and not more than 1,000,000,000, so the *Usage Fee* for that *Fiscal Year* is 250,000.
|
|
145
147
|
|
|
146
|
-
A company earns 4,000,000 in *
|
|
148
|
+
A company earns 4,000,000 in *Gross Income* from a product during a *Fiscal Year*. The product is built completely on *The Software*, so the *Contribution Estimate* is 0.5.
|
|
147
149
|
|
|
148
150
|
0.5 * 4,000,000 = 2,000,000
|
|
149
151
|
|
|
150
152
|
The *Derived Income* of 2,000,000 is more than 1,000,000 and not more than 10,000,000, so the *Usage Fee* for that *Fiscal Year* is 50,000.
|
|
151
153
|
|
|
152
|
-
A company earns 3,000,000 in *
|
|
154
|
+
A company earns 3,000,000 in *Gross Income* from a product line during a *Fiscal Year*. The company uses *The Software* for the QA and CI of that product line, so the *Contribution Estimate* is 0.3.
|
|
153
155
|
|
|
154
156
|
0.3 * 3,000,000 = 900,000
|
|
155
157
|
|
|
156
158
|
The *Derived Income* of 900,000 is 1,000,000 or less, so there is no *Usage Fee* for that *Fiscal Year*.
|
|
157
159
|
|
|
160
|
+
A company earns 50,000,000 in *Gross Income* from a line of medical devices during a *Fiscal Year*. The company uses *The Software* for the QA and CI of the devices, so the *Contribution Estimate* from the table is 0.3. The devices are not software, and the company reasonably estimates that their software accounts for one fifth (0.2) of the value of each shipped device, so the company reduces the *Contribution Estimate* to 0.06.
|
|
161
|
+
|
|
162
|
+
0.3 * 0.2 = 0.06
|
|
163
|
+
0.06 * 50,000,000 = 3,000,000
|
|
164
|
+
|
|
165
|
+
The *Derived Income* of 3,000,000 is more than 1,000,000 and not more than 10,000,000, so the *Usage Fee* for that *Fiscal Year* is 50,000. Without the reduction, the *Derived Income* would be 15,000,000 and the *Usage Fee* would be 100,000.
|
|
166
|
+
|
|
158
167
|
### 5.7 Reporting and Payment
|
|
159
|
-
Within one hundred twenty (120) days after the end of each *Fiscal Year* for which a *Usage Fee* is owed, *You* must pay the *Usage Fee* to *Licensor* and provide *Licensor* with a written statement that shows the *
|
|
168
|
+
Within one hundred twenty (120) days after the end of each *Fiscal Year* for which a *Usage Fee* is owed, *You* must pay the *Usage Fee* to *Licensor* and provide *Licensor* with a written statement that shows the *Gross Income*, the *Contribution Estimate*, the reasoning used to make the *Contribution Estimate*, the *Derived Income*, and the *Usage Fee*. *Usage Fees* are payable in United States dollars. If any *Gross Income* is not counted under section 5.4, the statement must also identify each product or service that is in a *Migration Period* and show the dates of its *Migration Period*. No statement is required for a *Fiscal Year* in which no *Usage Fee* is owed.
|
|
160
169
|
|
|
161
170
|
### 5.8 Records and Review
|
|
162
|
-
*You* must keep records that reasonably support each *Contribution Estimate*, each *
|
|
171
|
+
*You* must keep records that reasonably support each *Contribution Estimate*, including any share used to reduce it under section 5.5, each *Gross Income* figure, and the dates of any *Migration Period* for at least three (3) years after the end of the *Fiscal Year* that they apply to. No more than once in any twelve (12) month period, *Licensor* may ask in writing for the records that support a statement, and *You* must provide them within sixty (60) days of the request. *Licensor* will treat those records as confidential.
|
|
163
172
|
|
|
164
173
|
### 5.9 Disputes About the Usage Fee
|
|
165
|
-
If *Licensor* believes that a *Contribution Estimate*, a *
|
|
174
|
+
If *Licensor* believes that a *Contribution Estimate*, a *Gross Income* figure, or the dates of a *Migration Period* are not reasonable, *Licensor* will notify *You* in writing and explain why. *You* and *Licensor* will then negotiate in good faith for at least sixty (60) days to agree on a reasonable *Usage Fee*. If *You* and *Licensor* cannot agree, either party may resolve the dispute as described in section 8.
|
|
166
175
|
|
|
167
176
|
### 5.10 Fixed License Cost
|
|
168
177
|
For assurance of costs, *You* may disclose to *Licensor* how *You* *Use* *The Software* and the returns that *You* estimate *You* will derive from it, and negotiate a fixed license cost with *Licensor*. A fixed license cost, and any other terms that *You* and *Licensor* agree to, must be set out in a writing signed by both *You* and *Licensor* (a **Fixed License Agreement**).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codecraftai-restclient-tailscale
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.2
|
|
4
4
|
Summary: Code Craft AI - Tailscale REST Client
|
|
5
5
|
License-Expression: LicenseRef-CodeCraftAI-Source-Available
|
|
6
6
|
License-File: LICENSE.md
|
|
@@ -10,10 +10,10 @@ Author-email: myron.walker@gmail.com
|
|
|
10
10
|
Requires-Python: >=3.10,<4.0
|
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
|
12
12
|
Classifier: Operating System :: POSIX
|
|
13
|
-
Requires-Dist: codecraftai-credentials (
|
|
14
|
-
Requires-Dist: codecraftai-foundations (
|
|
15
|
-
Requires-Dist: codecraftai-restclient-base (
|
|
16
|
-
Requires-Dist: codecraftai-testbase (
|
|
13
|
+
Requires-Dist: codecraftai-credentials (>=1.0.0,<2.0.0)
|
|
14
|
+
Requires-Dist: codecraftai-foundations (>=1.0.0,<2.0.0)
|
|
15
|
+
Requires-Dist: codecraftai-restclient-base (>=1.0.0,<2.0.0)
|
|
16
|
+
Requires-Dist: codecraftai-testbase (>=1.0.0,<2.0.0)
|
|
17
17
|
Requires-Dist: pyyaml (>=6.0.2,<7.0.0)
|
|
18
18
|
Requires-Dist: requests (>=2.32.5,<3.0.0)
|
|
19
19
|
Project-URL: Issues, https://github.com/code-craft-ai-company/codecraftai-restclient-tailscale/issues
|
{codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/pyproject.toml
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "codecraftai-restclient-tailscale"
|
|
3
|
-
version = "1.2.
|
|
3
|
+
version = "1.2.2"
|
|
4
4
|
description = "Code Craft AI - Tailscale REST Client"
|
|
5
5
|
readme = "README.rst"
|
|
6
6
|
license = "LicenseRef-CodeCraftAI-Source-Available"
|
|
@@ -21,10 +21,10 @@ requires-python = ">=3.10,<4.0"
|
|
|
21
21
|
dependencies = [
|
|
22
22
|
"requests>=2.32.5,<3.0.0",
|
|
23
23
|
"pyyaml>=6.0.2,<7.0.0",
|
|
24
|
-
"codecraftai-foundations
|
|
25
|
-
"codecraftai-credentials
|
|
26
|
-
"codecraftai-restclient-base
|
|
27
|
-
"codecraftai-testbase
|
|
24
|
+
"codecraftai-foundations>=1.0.0,<2.0.0",
|
|
25
|
+
"codecraftai-credentials>=1.0.0,<2.0.0",
|
|
26
|
+
"codecraftai-restclient-base>=1.0.0,<2.0.0",
|
|
27
|
+
"codecraftai-testbase>=1.0.0,<2.0.0",
|
|
28
28
|
]
|
|
29
29
|
|
|
30
30
|
[project.urls]
|
|
@@ -40,25 +40,6 @@ dbio = []
|
|
|
40
40
|
[tool.poetry]
|
|
41
41
|
packages = [{include="ccai", from="source/packages"}]
|
|
42
42
|
|
|
43
|
-
[tool.poetry.dependencies]
|
|
44
|
-
codecraftai-foundations = {source = "codecraftai"}
|
|
45
|
-
codecraftai-credentials = {source = "codecraftai"}
|
|
46
|
-
codecraftai-restclient-base = {source = "codecraftai"}
|
|
47
|
-
codecraftai-testbase = {source = "codecraftai"}
|
|
48
|
-
|
|
49
|
-
[[tool.poetry.source]]
|
|
50
|
-
name = "codecraftai"
|
|
51
|
-
url = "https://code-craft.ai/licensed-repository/simple/"
|
|
52
|
-
priority = "supplemental"
|
|
53
|
-
|
|
54
|
-
[[tool.uv.index]]
|
|
55
|
-
# Same licensed index as [[tool.poetry.source]]. Listed before PyPI so that
|
|
56
|
-
# codecraftai-* packages (direct and transitive) resolve from it; everything
|
|
57
|
-
# else falls through to PyPI. Credentials: UV_INDEX_CODECRAFTAI_USERNAME /
|
|
58
|
-
# UV_INDEX_CODECRAFTAI_PASSWORD, or `uv auth login`.
|
|
59
|
-
name = "codecraftai"
|
|
60
|
-
url = "https://code-craft.ai/licensed-repository/simple/"
|
|
61
|
-
|
|
62
43
|
[tool.ruff.lint]
|
|
63
44
|
# Deliberately narrow. This gate exists for one reason: a bare `except:`
|
|
64
45
|
# swallows ConfigurationError and SemanticError, which derive from
|
|
@@ -14,7 +14,9 @@ __credits__ = []
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
import ast
|
|
17
|
+
import keyword
|
|
17
18
|
import os
|
|
19
|
+
import re
|
|
18
20
|
|
|
19
21
|
from typing import Any, Dict, List, Tuple
|
|
20
22
|
|
|
@@ -59,7 +61,9 @@ def class_name_for_schema(*, schema_name: str) -> str:
|
|
|
59
61
|
|
|
60
62
|
:returns: A ``Tailscale``-prefixed PascalCase class name.
|
|
61
63
|
"""
|
|
62
|
-
|
|
64
|
+
# Any character that cannot appear in an identifier separates words, so
|
|
65
|
+
# the class name is always a valid identifier.
|
|
66
|
+
cleaned = re.sub(r"[^0-9A-Za-z]", " ", schema_name)
|
|
63
67
|
parts = cleaned.split()
|
|
64
68
|
pascal_parts: List[str] = []
|
|
65
69
|
for part in parts:
|
|
@@ -102,16 +106,39 @@ def _emit_field_line(*, field_name: str, field_schema: Dict[str, Any],
|
|
|
102
106
|
desc_arg = ""
|
|
103
107
|
if description is not None:
|
|
104
108
|
flat = " ".join(description.split())
|
|
105
|
-
|
|
109
|
+
# Backslashes are escaped so spec text such as 'C:\\' cannot end
|
|
110
|
+
# the string literal early.
|
|
111
|
+
safe = flat.replace("\\", "\\\\").replace('"', "'")
|
|
106
112
|
desc_arg = ', description="{}"'.format(safe)
|
|
107
113
|
|
|
114
|
+
# A property whose wire name is not a usable identifier (a keyword such
|
|
115
|
+
# as 'class', or 'x-request-id') is assigned through the class namespace,
|
|
116
|
+
# so the field keeps its wire name and the module stays valid source.
|
|
117
|
+
if field_name.isidentifier() is True and keyword.iskeyword(field_name) is False:
|
|
118
|
+
target = field_name
|
|
119
|
+
else:
|
|
120
|
+
target = "locals()[{!r}]".format(field_name)
|
|
121
|
+
|
|
108
122
|
if required is True:
|
|
109
123
|
rtnval = ' {} = Field({}, required=True{})'.format(
|
|
110
|
-
|
|
124
|
+
target, py_type, desc_arg)
|
|
111
125
|
return rtnval
|
|
112
126
|
|
|
113
127
|
rtnval = ' {} = Field(Optional[{}], required=False, default=None{})'.format(
|
|
114
|
-
|
|
128
|
+
target, py_type, desc_arg)
|
|
129
|
+
return rtnval
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
def _docstring_text(*, text: str) -> str:
|
|
133
|
+
"""
|
|
134
|
+
Make spec text safe to place inside a triple-quoted docstring.
|
|
135
|
+
|
|
136
|
+
:param text: The flattened spec text.
|
|
137
|
+
|
|
138
|
+
:returns: The text with backslashes and triple quotes escaped, so it
|
|
139
|
+
cannot end the docstring and inject class-body code.
|
|
140
|
+
"""
|
|
141
|
+
rtnval = text.replace("\\", "\\\\").replace('"""', '\\"\\"\\"')
|
|
115
142
|
return rtnval
|
|
116
143
|
|
|
117
144
|
|
|
@@ -172,13 +199,13 @@ def emit_schema_module(*, schema_name: str,
|
|
|
172
199
|
|
|
173
200
|
description = schema.get("description")
|
|
174
201
|
doc_summary = "Auto-generated from Tailscale OpenAPI schema '{}'.".format(
|
|
175
|
-
schema_name)
|
|
202
|
+
_docstring_text(text=schema_name))
|
|
176
203
|
lines.append(' """')
|
|
177
204
|
lines.append(" {}".format(doc_summary))
|
|
178
205
|
if description is not None:
|
|
179
206
|
flat = " ".join(description.split())
|
|
180
207
|
lines.append("")
|
|
181
|
-
lines.append(" {}".format(flat))
|
|
208
|
+
lines.append(" {}".format(_docstring_text(text=flat)))
|
|
182
209
|
lines.append(' """')
|
|
183
210
|
|
|
184
211
|
properties = schema.get("properties")
|
|
@@ -21,7 +21,9 @@ from ccai.restclient.base.restapigroup import RestApiGroup
|
|
|
21
21
|
from ccai.restclient.tailscale.aspectstailscale import (
|
|
22
22
|
AspectsTailscale, DEFAULT_TAILSCALE_ASPECTS
|
|
23
23
|
)
|
|
24
|
-
from ccai.restclient.tailscale.apigroups.groupsupport import
|
|
24
|
+
from ccai.restclient.tailscale.apigroups.groupsupport import (
|
|
25
|
+
path_segment, raise_for_status
|
|
26
|
+
)
|
|
25
27
|
|
|
26
28
|
|
|
27
29
|
class AclsGroup(RestApiGroup):
|
|
@@ -45,7 +47,7 @@ class AclsGroup(RestApiGroup):
|
|
|
45
47
|
be ``None`` when the API omits the header.
|
|
46
48
|
"""
|
|
47
49
|
client = self.client
|
|
48
|
-
leaf = self.build_leaf(parts=["tailnet", client.tailnet, "acl"])
|
|
50
|
+
leaf = self.build_leaf(parts=["tailnet", path_segment(value=client.tailnet), "acl"])
|
|
49
51
|
response = client.request(method="GET", leaf=leaf, aspects=aspects)
|
|
50
52
|
raise_for_status(response=response, action="get acl")
|
|
51
53
|
|
|
@@ -80,7 +82,7 @@ class AclsGroup(RestApiGroup):
|
|
|
80
82
|
headers["If-Match"] = etag
|
|
81
83
|
|
|
82
84
|
client = self.client
|
|
83
|
-
leaf = self.build_leaf(parts=["tailnet", client.tailnet, "acl"])
|
|
85
|
+
leaf = self.build_leaf(parts=["tailnet", path_segment(value=client.tailnet), "acl"])
|
|
84
86
|
response = client.request(method="POST", leaf=leaf, json_body=acl_doc,
|
|
85
87
|
headers=headers, aspects=aspects)
|
|
86
88
|
raise_for_status(response=response, action="put acl")
|
|
@@ -21,7 +21,9 @@ from ccai.restclient.base.restapigroup import RestApiGroup
|
|
|
21
21
|
from ccai.restclient.tailscale.aspectstailscale import (
|
|
22
22
|
AspectsTailscale, DEFAULT_TAILSCALE_ASPECTS
|
|
23
23
|
)
|
|
24
|
-
from ccai.restclient.tailscale.apigroups.groupsupport import
|
|
24
|
+
from ccai.restclient.tailscale.apigroups.groupsupport import (
|
|
25
|
+
path_segment, raise_for_status
|
|
26
|
+
)
|
|
25
27
|
from ccai.restclient.tailscale.model.tailscaledevice import TailscaleDevice
|
|
26
28
|
|
|
27
29
|
|
|
@@ -46,7 +48,7 @@ class DevicesGroup(RestApiGroup):
|
|
|
46
48
|
:returns: A list of :class:`TailscaleDevice` models.
|
|
47
49
|
"""
|
|
48
50
|
client = self.client
|
|
49
|
-
leaf = self.build_leaf(parts=["tailnet", client.tailnet, "devices"])
|
|
51
|
+
leaf = self.build_leaf(parts=["tailnet", path_segment(value=client.tailnet), "devices"])
|
|
50
52
|
response = client.request(method="GET", leaf=leaf,
|
|
51
53
|
params={"fields": "all"}, aspects=aspects)
|
|
52
54
|
raise_for_status(response=response, action="list devices")
|
|
@@ -91,7 +93,7 @@ class DevicesGroup(RestApiGroup):
|
|
|
91
93
|
self._require_device_id(device_id=device_id)
|
|
92
94
|
|
|
93
95
|
client = self.client
|
|
94
|
-
leaf = self.build_leaf(parts=["device", device_id])
|
|
96
|
+
leaf = self.build_leaf(parts=["device", path_segment(value=device_id)])
|
|
95
97
|
response = client.request(method="GET", leaf=leaf,
|
|
96
98
|
params={"fields": "all"}, aspects=aspects)
|
|
97
99
|
raise_for_status(response=response, action="get device")
|
|
@@ -115,7 +117,7 @@ class DevicesGroup(RestApiGroup):
|
|
|
115
117
|
self._require_device_id(device_id=device_id)
|
|
116
118
|
|
|
117
119
|
client = self.client
|
|
118
|
-
leaf = self.build_leaf(parts=["device", device_id])
|
|
120
|
+
leaf = self.build_leaf(parts=["device", path_segment(value=device_id)])
|
|
119
121
|
response = client.request(method="DELETE", leaf=leaf, aspects=aspects)
|
|
120
122
|
|
|
121
123
|
status = response.status_code
|
|
@@ -141,7 +143,7 @@ class DevicesGroup(RestApiGroup):
|
|
|
141
143
|
self._require_device_id(device_id=device_id)
|
|
142
144
|
|
|
143
145
|
client = self.client
|
|
144
|
-
leaf = self.build_leaf(parts=["device", device_id, "authorized"])
|
|
146
|
+
leaf = self.build_leaf(parts=["device", path_segment(value=device_id), "authorized"])
|
|
145
147
|
body: Dict[str, Any] = {"authorized": authorized}
|
|
146
148
|
response = client.request(method="POST", leaf=leaf, json_body=body,
|
|
147
149
|
aspects=aspects)
|
|
@@ -164,7 +166,7 @@ class DevicesGroup(RestApiGroup):
|
|
|
164
166
|
raise SemanticError("'tags' must be a list of tag strings.")
|
|
165
167
|
|
|
166
168
|
client = self.client
|
|
167
|
-
leaf = self.build_leaf(parts=["device", device_id, "tags"])
|
|
169
|
+
leaf = self.build_leaf(parts=["device", path_segment(value=device_id), "tags"])
|
|
168
170
|
body: Dict[str, Any] = {"tags": list(tags)}
|
|
169
171
|
response = client.request(method="POST", leaf=leaf, json_body=body,
|
|
170
172
|
aspects=aspects)
|
|
@@ -185,7 +187,7 @@ class DevicesGroup(RestApiGroup):
|
|
|
185
187
|
self._require_device_id(device_id=device_id)
|
|
186
188
|
|
|
187
189
|
client = self.client
|
|
188
|
-
leaf = self.build_leaf(parts=["device", device_id, "key"])
|
|
190
|
+
leaf = self.build_leaf(parts=["device", path_segment(value=device_id), "key"])
|
|
189
191
|
body: Dict[str, Any] = {"keyExpiryDisabled": disabled}
|
|
190
192
|
response = client.request(method="POST", leaf=leaf, json_body=body,
|
|
191
193
|
aspects=aspects)
|
|
@@ -22,7 +22,7 @@ from ccai.restclient.tailscale.aspectstailscale import (
|
|
|
22
22
|
AspectsTailscale, DEFAULT_TAILSCALE_ASPECTS
|
|
23
23
|
)
|
|
24
24
|
from ccai.restclient.tailscale.apigroups.groupsupport import (
|
|
25
|
-
raise_for_status, safe_json
|
|
25
|
+
path_segment, raise_for_status, safe_json
|
|
26
26
|
)
|
|
27
27
|
|
|
28
28
|
|
|
@@ -153,7 +153,8 @@ class DnsGroup(RestApiGroup):
|
|
|
153
153
|
:returns: The decoded JSON object.
|
|
154
154
|
"""
|
|
155
155
|
client = self.client
|
|
156
|
-
leaf = self.build_leaf(parts=["tailnet", client.tailnet,
|
|
156
|
+
leaf = self.build_leaf(parts=["tailnet", path_segment(value=client.tailnet),
|
|
157
|
+
"dns", path_segment(value=resource)])
|
|
157
158
|
response = client.request(method="GET", leaf=leaf, aspects=aspects)
|
|
158
159
|
raise_for_status(response=response, action=action)
|
|
159
160
|
|
|
@@ -173,7 +174,8 @@ class DnsGroup(RestApiGroup):
|
|
|
173
174
|
:returns: ``None``.
|
|
174
175
|
"""
|
|
175
176
|
client = self.client
|
|
176
|
-
leaf = self.build_leaf(parts=["tailnet", client.tailnet,
|
|
177
|
+
leaf = self.build_leaf(parts=["tailnet", path_segment(value=client.tailnet),
|
|
178
|
+
"dns", path_segment(value=resource)])
|
|
177
179
|
response = client.request(method="POST", leaf=leaf, json_body=body,
|
|
178
180
|
aspects=aspects)
|
|
179
181
|
raise_for_status(response=response, action=action)
|
|
@@ -14,11 +14,40 @@ __credits__ = []
|
|
|
14
14
|
|
|
15
15
|
from typing import Any, Dict
|
|
16
16
|
|
|
17
|
+
from urllib.parse import quote
|
|
18
|
+
|
|
17
19
|
from requests import Response
|
|
18
20
|
|
|
21
|
+
from ccai.errors.exceptions import SemanticError
|
|
22
|
+
|
|
19
23
|
from ccai.restclient.tailscale.exceptions import classify_http_status
|
|
20
24
|
|
|
21
25
|
|
|
26
|
+
def path_segment(*, value: str) -> str:
|
|
27
|
+
"""
|
|
28
|
+
Percent-encode a caller-supplied identifier (device id, key id,
|
|
29
|
+
tailnet, ...) so it stays inside its own path segment: ``/``, ``?``,
|
|
30
|
+
``#`` and ``%`` in the value can neither add path segments, start a
|
|
31
|
+
query string or fragment, nor walk to another route.
|
|
32
|
+
|
|
33
|
+
An empty value is returned unchanged so ``build_leaf`` keeps
|
|
34
|
+
rejecting it with :class:`SemanticError`.
|
|
35
|
+
|
|
36
|
+
:param value: The identifier to encode.
|
|
37
|
+
|
|
38
|
+
:returns: The percent-encoded segment.
|
|
39
|
+
|
|
40
|
+
:raises: :class:`SemanticError` when the value is ``.`` or ``..``,
|
|
41
|
+
which would move the request to another route.
|
|
42
|
+
"""
|
|
43
|
+
if value in (".", ".."):
|
|
44
|
+
err_msg = "Path identifier {!r} does not name a path segment.".format(value)
|
|
45
|
+
raise SemanticError(err_msg)
|
|
46
|
+
|
|
47
|
+
rtnval = quote(value, safe="")
|
|
48
|
+
return rtnval
|
|
49
|
+
|
|
50
|
+
|
|
22
51
|
def raise_for_status(*, response: Response, action: str) -> None:
|
|
23
52
|
"""
|
|
24
53
|
Reclassify a non-2xx HTTP response into a typed
|
|
@@ -21,7 +21,9 @@ from ccai.restclient.base.restapigroup import RestApiGroup
|
|
|
21
21
|
from ccai.restclient.tailscale.aspectstailscale import (
|
|
22
22
|
AspectsTailscale, DEFAULT_TAILSCALE_ASPECTS
|
|
23
23
|
)
|
|
24
|
-
from ccai.restclient.tailscale.apigroups.groupsupport import
|
|
24
|
+
from ccai.restclient.tailscale.apigroups.groupsupport import (
|
|
25
|
+
path_segment, raise_for_status
|
|
26
|
+
)
|
|
25
27
|
from ccai.restclient.tailscale.model.tailscalekey import TailscaleKey
|
|
26
28
|
|
|
27
29
|
|
|
@@ -44,7 +46,7 @@ class KeysGroup(RestApiGroup):
|
|
|
44
46
|
:returns: A list of :class:`TailscaleKey` models.
|
|
45
47
|
"""
|
|
46
48
|
client = self.client
|
|
47
|
-
leaf = self.build_leaf(parts=["tailnet", client.tailnet, "keys"])
|
|
49
|
+
leaf = self.build_leaf(parts=["tailnet", path_segment(value=client.tailnet), "keys"])
|
|
48
50
|
response = client.request(method="GET", leaf=leaf,
|
|
49
51
|
params={"all": "true"}, aspects=aspects)
|
|
50
52
|
raise_for_status(response=response, action="list keys")
|
|
@@ -89,7 +91,8 @@ class KeysGroup(RestApiGroup):
|
|
|
89
91
|
self._require_key_id(key_id=key_id)
|
|
90
92
|
|
|
91
93
|
client = self.client
|
|
92
|
-
leaf = self.build_leaf(parts=["tailnet", client.tailnet,
|
|
94
|
+
leaf = self.build_leaf(parts=["tailnet", path_segment(value=client.tailnet),
|
|
95
|
+
"keys", path_segment(value=key_id)])
|
|
93
96
|
response = client.request(method="GET", leaf=leaf, aspects=aspects)
|
|
94
97
|
raise_for_status(response=response, action="get key")
|
|
95
98
|
|
|
@@ -125,7 +128,7 @@ class KeysGroup(RestApiGroup):
|
|
|
125
128
|
tags=tags, ttl_seconds=ttl_seconds)
|
|
126
129
|
|
|
127
130
|
client = self.client
|
|
128
|
-
leaf = self.build_leaf(parts=["tailnet", client.tailnet, "keys"])
|
|
131
|
+
leaf = self.build_leaf(parts=["tailnet", path_segment(value=client.tailnet), "keys"])
|
|
129
132
|
response = client.request(method="POST", leaf=leaf,
|
|
130
133
|
params={"all": "true"}, json_body=body,
|
|
131
134
|
aspects=aspects)
|
|
@@ -150,7 +153,8 @@ class KeysGroup(RestApiGroup):
|
|
|
150
153
|
self._require_key_id(key_id=key_id)
|
|
151
154
|
|
|
152
155
|
client = self.client
|
|
153
|
-
leaf = self.build_leaf(parts=["tailnet", client.tailnet,
|
|
156
|
+
leaf = self.build_leaf(parts=["tailnet", path_segment(value=client.tailnet),
|
|
157
|
+
"keys", path_segment(value=key_id)])
|
|
154
158
|
response = client.request(method="DELETE", leaf=leaf, aspects=aspects)
|
|
155
159
|
|
|
156
160
|
status = response.status_code
|
|
@@ -22,7 +22,7 @@ from ccai.restclient.tailscale.aspectstailscale import (
|
|
|
22
22
|
AspectsTailscale, DEFAULT_TAILSCALE_ASPECTS
|
|
23
23
|
)
|
|
24
24
|
from ccai.restclient.tailscale.apigroups.groupsupport import (
|
|
25
|
-
raise_for_status, safe_json
|
|
25
|
+
path_segment, raise_for_status, safe_json
|
|
26
26
|
)
|
|
27
27
|
from ccai.restclient.tailscale.model.tailscalepostureintegration import (
|
|
28
28
|
TailscalePostureIntegration
|
|
@@ -48,7 +48,7 @@ class PostureGroup(RestApiGroup):
|
|
|
48
48
|
"""
|
|
49
49
|
client = self.client
|
|
50
50
|
leaf = self.build_leaf(
|
|
51
|
-
parts=["tailnet", client.tailnet, "posture", "integrations"])
|
|
51
|
+
parts=["tailnet", path_segment(value=client.tailnet), "posture", "integrations"])
|
|
52
52
|
response = client.request(method="GET", leaf=leaf, aspects=aspects)
|
|
53
53
|
raise_for_status(response=response, action="list posture integrations")
|
|
54
54
|
|
|
@@ -94,7 +94,8 @@ class PostureGroup(RestApiGroup):
|
|
|
94
94
|
raise SemanticError("'integration_id' must be a non-empty string.")
|
|
95
95
|
|
|
96
96
|
client = self.client
|
|
97
|
-
leaf = self.build_leaf(parts=["posture", "integrations",
|
|
97
|
+
leaf = self.build_leaf(parts=["posture", "integrations",
|
|
98
|
+
path_segment(value=integration_id)])
|
|
98
99
|
response = client.request(method="GET", leaf=leaf, aspects=aspects)
|
|
99
100
|
raise_for_status(response=response, action="get posture integration")
|
|
100
101
|
|
|
@@ -112,7 +113,7 @@ class PostureGroup(RestApiGroup):
|
|
|
112
113
|
"""
|
|
113
114
|
client = self.client
|
|
114
115
|
leaf = self.build_leaf(
|
|
115
|
-
parts=["tailnet", client.tailnet, "devices", "posture",
|
|
116
|
+
parts=["tailnet", path_segment(value=client.tailnet), "devices", "posture",
|
|
116
117
|
"integrations", "signing-nodes"])
|
|
117
118
|
response = client.request(method="GET", leaf=leaf, aspects=aspects)
|
|
118
119
|
raise_for_status(response=response, action="list signing nodes")
|
|
@@ -21,7 +21,9 @@ from ccai.restclient.base.restapigroup import RestApiGroup
|
|
|
21
21
|
from ccai.restclient.tailscale.aspectstailscale import (
|
|
22
22
|
AspectsTailscale, DEFAULT_TAILSCALE_ASPECTS
|
|
23
23
|
)
|
|
24
|
-
from ccai.restclient.tailscale.apigroups.groupsupport import
|
|
24
|
+
from ccai.restclient.tailscale.apigroups.groupsupport import (
|
|
25
|
+
path_segment, raise_for_status
|
|
26
|
+
)
|
|
25
27
|
from ccai.restclient.tailscale.model.tailscaletailnetsettings import (
|
|
26
28
|
TailscaleTailnetSettings
|
|
27
29
|
)
|
|
@@ -45,7 +47,7 @@ class TailnetsGroup(RestApiGroup):
|
|
|
45
47
|
:returns: A :class:`TailscaleTailnetSettings` model.
|
|
46
48
|
"""
|
|
47
49
|
client = self.client
|
|
48
|
-
leaf = self.build_leaf(parts=["tailnet", client.tailnet, "settings"])
|
|
50
|
+
leaf = self.build_leaf(parts=["tailnet", path_segment(value=client.tailnet), "settings"])
|
|
49
51
|
response = client.request(method="GET", leaf=leaf, aspects=aspects)
|
|
50
52
|
raise_for_status(response=response, action="get tailnet settings")
|
|
51
53
|
|
|
@@ -68,7 +70,7 @@ class TailnetsGroup(RestApiGroup):
|
|
|
68
70
|
raise SemanticError("'settings' must be a dictionary.")
|
|
69
71
|
|
|
70
72
|
client = self.client
|
|
71
|
-
leaf = self.build_leaf(parts=["tailnet", client.tailnet, "settings"])
|
|
73
|
+
leaf = self.build_leaf(parts=["tailnet", path_segment(value=client.tailnet), "settings"])
|
|
72
74
|
response = client.request(method="PATCH", leaf=leaf, json_body=settings,
|
|
73
75
|
aspects=aspects)
|
|
74
76
|
raise_for_status(response=response, action="update tailnet settings")
|
|
@@ -16,7 +16,7 @@ __credits__ = []
|
|
|
16
16
|
import os
|
|
17
17
|
import time
|
|
18
18
|
|
|
19
|
-
from typing import Callable, Optional
|
|
19
|
+
from typing import Callable, Optional, Tuple
|
|
20
20
|
|
|
21
21
|
from requests import Response, Session
|
|
22
22
|
|
|
@@ -96,7 +96,8 @@ class OAuthBearer:
|
|
|
96
96
|
def mint_bearer(*, credential: TailscaleOAuthCredential, host_url: str,
|
|
97
97
|
verify_certificate: bool,
|
|
98
98
|
session_factory: Optional[Callable[[], Session]] = None,
|
|
99
|
-
now: Optional[float] = None
|
|
99
|
+
now: Optional[float] = None,
|
|
100
|
+
timeout: Optional[Tuple[float, float]] = None) -> OAuthBearer:
|
|
100
101
|
"""
|
|
101
102
|
Mint a fresh OAuth bearer token using the ``client_credentials``
|
|
102
103
|
flow against the Tailscale OAuth token endpoint.
|
|
@@ -108,6 +109,10 @@ def mint_bearer(*, credential: TailscaleOAuthCredential, host_url: str,
|
|
|
108
109
|
:class:`Session` used for the mint call. Defaults to a fresh
|
|
109
110
|
:class:`Session`.
|
|
110
111
|
:param now: Optional epoch-second override for expiry computation.
|
|
112
|
+
:param timeout: The ``(connect, read)`` timeout for the mint call,
|
|
113
|
+
normally ``(aspects.connection_timeout,
|
|
114
|
+
aspects.inactivity_timeout)``. ``None`` waits without limit and
|
|
115
|
+
is kept only for compatibility; the client always passes one.
|
|
111
116
|
|
|
112
117
|
:returns: A populated :class:`OAuthBearer` cache object.
|
|
113
118
|
|
|
@@ -129,7 +134,8 @@ def mint_bearer(*, credential: TailscaleOAuthCredential, host_url: str,
|
|
|
129
134
|
}
|
|
130
135
|
|
|
131
136
|
response: Response = mint_session.post(token_url, data=form_payload,
|
|
132
|
-
verify=verify_certificate
|
|
137
|
+
verify=verify_certificate,
|
|
138
|
+
timeout=timeout)
|
|
133
139
|
|
|
134
140
|
if response.status_code < 200 or response.status_code >= 300:
|
|
135
141
|
err_msg_lines = ["Failed to mint Tailscale OAuth token."]
|
|
@@ -286,7 +286,7 @@ class TailscaleClient(RestClientBase):
|
|
|
286
286
|
Resolve the bearer token for outbound calls.
|
|
287
287
|
|
|
288
288
|
:param aspects: Behaviour-control aspects supplying the OAuth
|
|
289
|
-
refresh margin.
|
|
289
|
+
refresh margin and the mint call's timeouts.
|
|
290
290
|
:param force_remint: When ``True``, force an OAuth re-mint.
|
|
291
291
|
|
|
292
292
|
:returns: The bearer token string.
|
|
@@ -307,7 +307,9 @@ class TailscaleClient(RestClientBase):
|
|
|
307
307
|
self._bearer = mint_bearer(credential=oauth_cred,
|
|
308
308
|
host_url=self._host_url,
|
|
309
309
|
verify_certificate=self._verify_certificate,
|
|
310
|
-
now=now_ts
|
|
310
|
+
now=now_ts,
|
|
311
|
+
timeout=(aspects.connection_timeout,
|
|
312
|
+
aspects.inactivity_timeout))
|
|
311
313
|
|
|
312
314
|
rtnval = self._bearer.token
|
|
313
315
|
return rtnval
|
{codecraftai_restclient_tailscale-1.2.0 → codecraftai_restclient_tailscale-1.2.2}/README.rst
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|