Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Merge for release #523

Merged
merged 61 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
374d3fc
feat: Annotated Text component
Jun 13, 2024
469faea
fix: handle template in `BuilderFieldsKeyValue`. WF-31
madeindjs Jul 1, 2024
2d4ae72
fix: got rid of name shortener for the annotated text component
Jul 8, 2024
29de0f2
fix: default to init value for annotated text component init value
Jul 8, 2024
924a1f9
feat: rem -> px in annotated text component
Jul 8, 2024
671547a
feat: moved copy buttons bar from AnnotatedText to a separate BaseCon…
Jul 8, 2024
249e9a0
fix: linting fixes for AnnotatedText
Jul 8, 2024
780662b
feat: implement editable dataframe to manage dataframe editor component
FabienArcellier Jul 1, 2024
0bf4c15
feat: implement editable dataframe to manage dataframe editor component
FabienArcellier Jul 4, 2024
d9d9fd0
feat: implement editable dataframe to manage dataframe editor component
FabienArcellier Jul 12, 2024
8bdf021
feat: implement editable dataframe to manage dataframe editor component
FabienArcellier Jul 12, 2024
9236669
feat: implement editable dataframe to manage dataframe editor component
FabienArcellier Jul 16, 2024
0cdb009
improve documentation to use writer instead of streamsync
FabienArcellier Jun 25, 2024
0aef7a2
refactor: use click for CLI (#457)
raaymax Jul 23, 2024
54d0cfc
Make corrections to release notes generator
samjulien Jul 24, 2024
84321c1
fix(ui): fix `CoreDataFrame` download for big file. WF-39
madeindjs Jul 25, 2024
48b1422
ci: bump Node version to `20.x`
madeindjs Jul 25, 2024
e29b0eb
feat(ui): allow empty name for `CoreMetric`. WF-38
madeindjs Jul 25, 2024
fc2719e
Reformat release notes tutorial by feature
samjulien Jul 25, 2024
4b8962f
fix: addressing PR comments
Jul 29, 2024
5a3cb5d
Merge branch 'dev' into dev
polymorpheuz Jul 29, 2024
52837d5
Merge pull request #474 from FabienArcellier/dev
ramedina86 Jul 29, 2024
61fddf9
Merge pull request #500 from samjulien/docs-release-notes-updates
anant-writer Jul 29, 2024
b657e81
Merge pull request #485 from FabienArcellier/65-implement-editable-da…
ramedina86 Jul 29, 2024
7d92d02
Merge pull request #497 from madeindjs/WF-39
ramedina86 Jul 29, 2024
dbe0190
Merge pull request #498 from madeindjs/ci-bump-node
ramedina86 Jul 29, 2024
e3ed971
Merge pull request #499 from madeindjs/WF-38
ramedina86 Jul 29, 2024
916015b
feat: substituted execCommand with writeText
Jul 30, 2024
37b25b1
Merge pull request #484 from madeindjs/WF-31
ramedina86 Jul 30, 2024
4e50299
feat(ui): improve `CoreFileInput`
madeindjs Jul 18, 2024
79a4276
fix: imports for coreannotatedtext
Jul 31, 2024
ede0cf7
fix: addressing prettier
Aug 2, 2024
0bfddf9
feat: added preview picture
Aug 5, 2024
633b748
chore: bump commit to make sure that the weird error persists
Aug 5, 2024
1120e3a
fix: Redirect after authentication on http://localhost without /
FabienArcellier Aug 5, 2024
8913014
feat(ui): extends `WdsButton`. WF-33
madeindjs Aug 6, 2024
8ea372f
fix(ui): remove overflow constraints (for `CoreSelect`)
madeindjs Jul 30, 2024
2f1f9a5
fix(ui): avoid builder `textarea` H resizable. WF-40
madeindjs Aug 6, 2024
0a8f229
feat(ui): add icon to `WdsTextInput`. WF-36
madeindjs Aug 8, 2024
4ad359e
fix: Redirect after authentication on http://localhost without /
FabienArcellier Aug 9, 2024
447f581
fix: Redirect after authentication on http://localhost without /
FabienArcellier Aug 9, 2024
c98d4c2
Merge pull request #511 from madeindjs/WF-36
ramedina86 Aug 12, 2024
77c8d41
Merge pull request #504 from madeindjs/fix-380
ramedina86 Aug 12, 2024
bbe184b
Merge pull request #510 from madeindjs/WF-40
ramedina86 Aug 12, 2024
514705a
Merge pull request #507 from FabienArcellier/501-redirect-after-authe…
ramedina86 Aug 12, 2024
7d19c42
fix: e2e fix
Aug 12, 2024
4acd3d3
feat: description image
Aug 12, 2024
0f4e1cb
feat: another guess for fixing e2e
Aug 12, 2024
8a80db3
Merge pull request #494 from madeindjs/WF-33
ramedina86 Aug 13, 2024
ce99061
Fixing error on auth guide which was causing mintlify deploy to fail
anant-writer Aug 14, 2024
ede9c75
Merge pull request #462 from polymorpheuz/dev
ramedina86 Aug 14, 2024
2a51e7b
fix: Fix safe text
ramedina86 Aug 16, 2024
7530011
fix: Field name
ramedina86 Aug 16, 2024
97cf52f
Merge pull request #521 from writer/feat-annotatedtext
ramedina86 Aug 16, 2024
9ba58b0
feat: Applications generate content support in AI module
ramedina86 Aug 16, 2024
d24f0b4
fix: Types
ramedina86 Aug 16, 2024
e3f6281
fix: Types
ramedina86 Aug 16, 2024
8df280b
fix: Linter
ramedina86 Aug 16, 2024
dfedc04
chore: Poetry add python multipart
ramedina86 Aug 16, 2024
7e2474d
Merge pull request #522 from writer/feat-aigeneratecontent
ramedina86 Aug 16, 2024
1026de3
chore: Bump version
ramedina86 Aug 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "18.x"
node-version: "20.x"
cache: npm

- name: install python3 environment
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "18.x"
node-version: "20.x"
cache: npm

- name: install python3 environment
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "18.x"
node-version: "20.x"
cache: npm

- name: install python3 environment
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "18.x"
node-version: "20.x"
cache: npm

- name: install python3 environment
Expand Down
14 changes: 9 additions & 5 deletions alfred/ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
def ci(front, back, e2e, docs):
no_flags = (not front and not back and not e2e and not docs)

if front or no_flags:
alfred.invoke_command("npm.lint")
alfred.invoke_command("npm.build")
if back or no_flags:
alfred.invoke_command("ci.mypy")
alfred.invoke_command("ci.ruff")
alfred.invoke_command("ci.pytest")
if front or no_flags:
alfred.invoke_command("npm.lint")
alfred.invoke_command("npm.build")
if docs or no_flags:
alfred.invoke_command("npm.docs.test")
if e2e:
Expand All @@ -32,8 +32,12 @@ def ci_mypy():
alfred.run("mypy ./src/writer --exclude app_templates/*")

@alfred.command("ci.ruff", help="linting with ruff")
def ci_ruff():
alfred.run("ruff check")
@alfred.option('--fix', '-f', help="fix linting errors", is_flag=True, default=False)
def ci_ruff(fix):
if fix:
alfred.run("ruff check --fix")
else:
alfred.run("ruff check")

@alfred.command("ci.pytest", help="run pytest on ./tests")
def ci_test():
Expand Down
2 changes: 1 addition & 1 deletion docs/components/component_page.mdx.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ A function, in this example `handle_event`, should be implemented in your code t

## Reference

* <a href="https://github.com/streamsync-cloud/streamsync/blob/dev/src/ui/{{fileRef}}" target="_blank" >Explore this component's source code on GitHub</a>
* <a href="https://github.com/writer/writer-framework/blob/dev/src/ui/{{fileRef}}" target="_blank" >Explore this component's source code on GitHub</a>
46 changes: 15 additions & 31 deletions docs/framework/authentication.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
title: "Authentication"
---

The Writer Framework authentication module allows you to restrict access to your application.

Framework will be able to authenticate a user through an identity provider such as Google, Microsoft, Facebook, Github, Auth0, etc.
The Writer Framework authentication module allows you to restrict access to your application. Framework will be able to authenticate a user through an identity provider such as Google, Microsoft, Facebook, Github, Auth0, etc.

<Warning>
Authentication is done before accessing the application. It is not possible to
Expand All @@ -13,19 +11,13 @@ Framework will be able to authenticate a user through an identity provider such

## Use Basic Auth

Basic Auth is a simple authentication method that uses a username and password. Authentication configuration is done in [the `server_setup.py` module](custom-server.md).

::: warning Password authentication is not safe for critical application
Basic Auth authentication is not secure for critical applications.
Basic Auth is a simple authentication method that uses a username and password. Authentication configuration is done in the [server_setup.py module](/framework/custom-server).

A user can intercept the plaintext password if https encryption fails.
It may also try to force password using brute force attacks.

For added security, it's recommended to use identity provider (Google, Microsoft, Facebook, Github, Auth0, etc.).
:::
<Warning>
Password authentication and Basic Auth are not sufficiently secure for critical applications. If HTTPS encryption fails, a user could potentially intercept passwords in plaintext. Additionally, these methods are vulnerable to brute force attacks that attempt to crack passwords. To enhance security, it is advisable to implement authentication through trusted identity providers such as Google, Microsoft, Facebook, GitHub, or Auth0.
</Warning>

*server_setup.py*
```python
```python server_setup.py
import os
import writer.serve
import writer.auth
Expand All @@ -41,12 +33,12 @@ writer.serve.register_auth(auth)
### Brute force protection

A simple brute force protection is implemented by default. If a user fails to log in, the IP of this user is blocked.
Writer framework will ban the IP from either the X-Forwarded-For header or the X-Real-IP header or the client IP address.
Writer framework will ban the IP from either the `X-Forwarded-For` header or the `X-Real-IP` header or the client IP address.

When a user fails to log in, they wait 1 second before they can try again. This time can be modified by
modifying the value of delay_after_failure.
modifying the value of `delay_after_failure`.

<img src="./images/auth_too_many_request.png" style="width: 100%; margin: auto">
![429](/framework/images/429.png)

## Use OIDC provider

Expand All @@ -55,9 +47,7 @@ Here is an example configuration for Google.

![Authentication OIDC Principle](/framework/images/auth.png)

**server_setup.py**

```python
```python server_setup.py
import os
import writer.serve
import writer.auth
Expand Down Expand Up @@ -88,9 +78,7 @@ The Writer Framework provides pre-configured OIDC providers. You can use them di

You have to register your application into [Google Cloud Console](https://console.cloud.google.com/).

_server_setup.py_

```python
```python server_setup.py
import os
import writer.serve
import writer.auth
Expand All @@ -108,9 +96,7 @@ writer.serve.register_auth(oidc)

You have to register your application into [Github](https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/registering-a-github-app#registering-a-github-app)

_server_setup.py_

```python
```python server_setup.py
import os
import writer.serve
import writer.auth
Expand All @@ -128,9 +114,8 @@ writer.serve.register_auth(oidc)

You have to register your application into [Auth0](https://auth0.com/).

_server_setup.py_

```python
```python server_setup.py
import os
import writer.serve
import writer.auth
Expand All @@ -147,13 +132,14 @@ writer.serve.register_auth(oidc)

### Authentication workflow

<img src="./framework/images/authentication_oidc.png" />
<img src="/framework/images/authentication_oidc.png" />

## User information in event handler

When the `user_info` route is configured, user information will be accessible
in the event handler through the `session` argument.


```python
def on_page_load(state, session):
email = session['userinfo'].get('email', None)
Expand Down Expand Up @@ -189,8 +175,6 @@ The default authentication error page look like this:

<img src="/framework/images/auth_unauthorized_default.png" />

_streamsync.auth.Unauthorized_

| Parameter | Description |
| ----------- | ---------------------- |
| status_code | HTTP status code |
Expand Down
10 changes: 5 additions & 5 deletions docs/framework/backend-driven-ui.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ with ui.find(container):

### Component methods

UI manager contains methods linked to each front-end component. For example, in previous code snippets we provide a `ui.Text` method, which is used for creating [Text components](https://www.streamsync.cloud/component-list.html#text).
UI manager contains methods linked to each front-end component. For example, in previous code snippets we provide a `ui.Text` method, which is used for creating [Text components](https://dev.writer.com/components/text).

This method expects `content: dict` as first argument, which enables you to set the field properties of the component, through corresponding keys:
```python
Expand Down Expand Up @@ -147,7 +147,7 @@ In addition to `content`, a set of fields which is specific to the component typ
</Note>
- **`position: int`**: Determines the display order of the component in relation to its siblings.
Position `0` means that the component is the first child of its parent.
Position `-2` is used for components – such as [sidebars](https://www.streamsync.cloud/component-list.html#sidebar) – that have a specific reserved position not related to their siblings.
Position `-2` is used for components – such as [sidebars](https://dev.writer.com/components/sidebar) – that have a specific reserved position not related to their siblings.
```python
ui.Text(
{"text": "Hello Parent, I'm your first child!"},
Expand All @@ -170,7 +170,7 @@ In addition to `content`, a set of fields which is specific to the component typ

ui.Text({"text": "My visibility depends on the @{my_var}!"}, visible="my_var")
```
- **`handlers: dict[str, callable]`**: Attaches [event handlers](https://www.streamsync.cloud/event-handlers.html) to the component. Each dictionary key represents an event, and its value is the corresponding handler.:
- **`handlers: dict[str, callable]`**: Attaches [event handlers](https://dev.writer.com/framework/event-handlersl) to the component. Each dictionary key represents an event, and its value is the corresponding handler.:
```python
def increment(state):
state["counter"] += 1
Expand All @@ -190,7 +190,7 @@ In addition to `content`, a set of fields which is specific to the component typ
# Both approaches yield the same outcome.
```
*A component can be linked to multiple event handlers.*
- **`binding: dict[str, str]`**: Links the component to a state variable via [binding](https://www.streamsync.cloud/builder-basics.html#binding). The dictionary key is the bindable event, and the value is the state variable's name:
- **`binding: dict[str, str]`**: Links the component to a state variable via [binding](https://dev.writer.com/framework/builder-basics#binding). The dictionary key is the bindable event, and the value is the state variable's name:
```python
initial_state = wf.init_state({
"header_text": "Default Text"
Expand Down Expand Up @@ -269,4 +269,4 @@ with ui.refresh_with(id="cmc-column-1"):
{"text": 'To Hello World, or not to Hello World?'},
id="hello-world-new"
)
```
```
Loading
Loading