Skip to content

Commit 542156e

Browse files
Version Packages (#496)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 516a35f commit 542156e

File tree

7 files changed

+143
-80
lines changed

7 files changed

+143
-80
lines changed

.changeset/orange-geckos-matter.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

.changeset/three-tables-occur.md

Lines changed: 0 additions & 67 deletions
This file was deleted.

.changeset/wise-walls-argue.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/effect-http-node/CHANGELOG.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,76 @@
11
# effect-http-node
22

3+
## 0.8.0
4+
5+
### Minor Changes
6+
7+
- [#497](https://github.com/sukovanej/effect-http/pull/497) [`37db9ad`](https://github.com/sukovanej/effect-http/commit/37db9ad8ea12df0d3f6562cce8319cf3f570a70c) Thanks [@sukovanej](https://github.com/sukovanej)! - New security API.
8+
9+
The security was completely reworked to increase the flexibility how
10+
the server deals with authorization and authentication.
11+
12+
The `SecurityScheme` module was removed and replaced by a new `Security` module.
13+
It exposes a new `Security<A, E, R>` type that captures the security handling
14+
and the OpenAPI specification. It also exposes a set of combinators that allow
15+
to combine `Security` specs and enhance them with arbitrary effectful computations.
16+
17+
Before
18+
19+
```ts
20+
const api = Api.make().pipe(
21+
Api.addEndpoint(
22+
Api.post("mySecuredEndpoint", "/my-secured-endpoint").pipe(
23+
Api.setResponseBody(Schema.string),
24+
Api.addSecurity("mySecurity", {
25+
type: "http",
26+
options: {
27+
scheme: "basic",
28+
},
29+
schema: Schema.Secret,
30+
}),
31+
),
32+
),
33+
);
34+
```
35+
36+
After
37+
38+
```ts
39+
const api = Api.make().pipe(
40+
Api.addEndpoint(
41+
Api.post("mySecuredEndpoint", "/my-secured-endpoint").pipe(
42+
Api.setResponseBody(Schema.string),
43+
Api.setSecurity(Security.basic()),
44+
),
45+
),
46+
);
47+
```
48+
49+
The client was modified to support the new security API. The second security argument
50+
of endpoint methods was replaced by a general `(request: ClientRequest) => ClientRequest`
51+
mapping. `Client` exposes two new helper functions `Client.setBasic` and `Client.setBearer`.
52+
53+
Before
54+
55+
```ts
56+
client.security({ ... }, { mySecurity: '...' })
57+
```
58+
59+
After
60+
61+
```ts
62+
client.endpoint({ ... }, Client.setBasic("user", "pass"))
63+
```
64+
65+
Please refer to the main readme for more information on the new security API.
66+
67+
### Patch Changes
68+
69+
- [#495](https://github.com/sukovanej/effect-http/pull/495) [`c765639`](https://github.com/sukovanej/effect-http/commit/c765639628cb416d0a165cc0012bd67a35ab0eb7) Thanks [@sukovanej](https://github.com/sukovanej)! - Update effect.
70+
71+
- Updated dependencies [[`c765639`](https://github.com/sukovanej/effect-http/commit/c765639628cb416d0a165cc0012bd67a35ab0eb7), [`37db9ad`](https://github.com/sukovanej/effect-http/commit/37db9ad8ea12df0d3f6562cce8319cf3f570a70c), [`7d65607`](https://github.com/sukovanej/effect-http/commit/7d65607aa64faea53bdd5952f9c5280be1d0c054)]:
72+
- effect-http@0.60.0
73+
374
## 0.7.2
475

576
### Patch Changes

packages/effect-http-node/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "effect-http-node",
33
"type": "module",
4-
"version": "0.7.2",
4+
"version": "0.8.0",
55
"license": "MIT",
66
"author": "Milan Suk <Milansuk@email.cz>",
77
"description": "High-level declarative HTTP API for effect-ts",

packages/effect-http/CHANGELOG.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,75 @@
11
# effect-http
22

3+
## 0.60.0
4+
5+
### Minor Changes
6+
7+
- [#497](https://github.com/sukovanej/effect-http/pull/497) [`37db9ad`](https://github.com/sukovanej/effect-http/commit/37db9ad8ea12df0d3f6562cce8319cf3f570a70c) Thanks [@sukovanej](https://github.com/sukovanej)! - New security API.
8+
9+
The security was completely reworked to increase the flexibility how
10+
the server deals with authorization and authentication.
11+
12+
The `SecurityScheme` module was removed and replaced by a new `Security` module.
13+
It exposes a new `Security<A, E, R>` type that captures the security handling
14+
and the OpenAPI specification. It also exposes a set of combinators that allow
15+
to combine `Security` specs and enhance them with arbitrary effectful computations.
16+
17+
Before
18+
19+
```ts
20+
const api = Api.make().pipe(
21+
Api.addEndpoint(
22+
Api.post("mySecuredEndpoint", "/my-secured-endpoint").pipe(
23+
Api.setResponseBody(Schema.string),
24+
Api.addSecurity("mySecurity", {
25+
type: "http",
26+
options: {
27+
scheme: "basic",
28+
},
29+
schema: Schema.Secret,
30+
}),
31+
),
32+
),
33+
);
34+
```
35+
36+
After
37+
38+
```ts
39+
const api = Api.make().pipe(
40+
Api.addEndpoint(
41+
Api.post("mySecuredEndpoint", "/my-secured-endpoint").pipe(
42+
Api.setResponseBody(Schema.string),
43+
Api.setSecurity(Security.basic()),
44+
),
45+
),
46+
);
47+
```
48+
49+
The client was modified to support the new security API. The second security argument
50+
of endpoint methods was replaced by a general `(request: ClientRequest) => ClientRequest`
51+
mapping. `Client` exposes two new helper functions `Client.setBasic` and `Client.setBearer`.
52+
53+
Before
54+
55+
```ts
56+
client.security({ ... }, { mySecurity: '...' })
57+
```
58+
59+
After
60+
61+
```ts
62+
client.endpoint({ ... }, Client.setBasic("user", "pass"))
63+
```
64+
65+
Please refer to the main readme for more information on the new security API.
66+
67+
### Patch Changes
68+
69+
- [#495](https://github.com/sukovanej/effect-http/pull/495) [`c765639`](https://github.com/sukovanej/effect-http/commit/c765639628cb416d0a165cc0012bd67a35ab0eb7) Thanks [@sukovanej](https://github.com/sukovanej)! - Update effect.
70+
71+
- [#499](https://github.com/sukovanej/effect-http/pull/499) [`7d65607`](https://github.com/sukovanej/effect-http/commit/7d65607aa64faea53bdd5952f9c5280be1d0c054) Thanks [@sukovanej](https://github.com/sukovanej)! - Fix `void` client response.
72+
373
## 0.59.2
474

575
### Patch Changes

packages/effect-http/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "effect-http",
33
"type": "module",
4-
"version": "0.59.2",
4+
"version": "0.60.0",
55
"license": "MIT",
66
"author": "Milan Suk <Milansuk@email.cz>",
77
"description": "High-level declarative HTTP API for effect-ts",

0 commit comments

Comments
 (0)