diff --git a/docs/enrollment_diagram.md b/docs/enrollment_diagram.md
index e6c52bd..0909c59 100644
--- a/docs/enrollment_diagram.md
+++ b/docs/enrollment_diagram.md
@@ -4,34 +4,34 @@ sequenceDiagram
participant User
participant Client
participant Server
- Note over User,Client: Enrollment
+ Note over User,Server: Enrollment
Client->>User: Signup Form
Note left of User: email: user@example.com
User->>Client: Submit Email
Client->>+Server: Signup Session: user@example.com
Server->>Server: Create Signup Session
- Note over User,Client: Set nKode
+ Note over User,Server: Set nKode
Server-->>-Client: signup_session_id, set_keypad, icons
- Note left of Server: signup_session_id:
92a2a1c6-3146-4d47-ac00-5160a7ebf104
- Note left of Server: set_keypad:
Key 0: [ 7 14 3 28 23]
Key 1: [ 1 26 15 10 5]
Key 2: [13 20 27 4 29]
Key 3: [25 8 21 16 11]
Key 4: [19 2 9 22 17]
+ Note left of Server: signup_session_id:
e029138e-fb64-49ea-a6bc-b6b5affbf263
+ Note left of Server: set_keypad:
Key 0: [18 7 20 22 23]
Key 1: [12 13 8 28 29]
Key 2: [24 25 26 16 5]
Key 3: [ 6 19 2 10 11]
Key 4: [ 0 1 14 4 17]
Note left of Server: Icons:
[😀,😂,🥳,😍,🤓
😎,🥺,😡,😱,🤯
🥰,😴,🤔,🙃,😇
🤖,👽,👾,🐱,🐶
🦁,🐻,🐸,🐙,🦄
🌟,⚡,🔥,🍕,🎉]
Client->>Client: Order Icons by keypad
Client->>User: Display Keypad
- Note left of Client: Key 0: ['😡' '😇' '😍' '🍕' '🐙']
Key 1: ['😂' '⚡' '🤖' '🥰' '😎']
Key 2: ['🙃' '🦁' '🔥' '🤓' '🎉']
Key 3: ['🌟' '😱' '🐻' '👽' '😴']
Key 4: ['🐶' '🥳' '🤯' '🐸' '👾']
- Note left of User: User icons: ['😍' '🤓' '😇' '😡']
- User->>Client: Set Key Selection: [0, 2, 0, 0]
- Client->>+Server: Set nKode:
92a2a1c6-3146-4d47-ac00-5160a7ebf104
[0, 2, 0, 0]
+ Note left of Client: Key 0: ['🐱' '😡' '🦁' '🐸' '🐙']
Key 1: ['🤔' '🙃' '😱' '🍕' '🎉']
Key 2: ['🦄' '🌟' '⚡' '👽' '😎']
Key 3: ['🥺' '🐶' '🥳' '🥰' '😴']
Key 4: ['😀' '😂' '😇' '🤓' '👾']
+ Note left of User: User icons: ['🐱' '🥳' '🐶' '⚡']
+ User->>Client: Set Key Selection: [0, 3, 3, 2]
+ Client->>+Server: Set nKode:
e029138e-fb64-49ea-a6bc-b6b5affbf263
[0, 3, 3, 2]
Server->>Server: Disperse Set Keypad
- Note over User,Client: Confirm nKode
+ Note over User,Server: Confirm nKode
Server-->>-Client: signup_session_id, confirm_keypad, icons
- Note left of Server: signup_session_id:
92a2a1c6-3146-4d47-ac00-5160a7ebf104
- Note left of Server: confirm_keypad:
Key 0: [ 7 26 21 4 17]
Key 1: [19 20 3 16 5]
Key 2: [ 1 8 9 28 29]
Key 3: [13 14 15 22 11]
Key 4: [25 2 27 10 23]
+ Note left of Server: signup_session_id:
e029138e-fb64-49ea-a6bc-b6b5affbf263
+ Note left of Server: confirm_keypad:
Key 0: [ 6 7 8 16 17]
Key 1: [ 0 13 2 22 5]
Key 2: [24 19 14 28 23]
Key 3: [18 1 26 10 29]
Key 4: [12 25 20 4 11]
Client->>Client: Order Icons by keypad
Client->>User: Display Keypad
- Note left of Client: Key 0: ['😡' '⚡' '🐻' '🤓' '👾']
Key 1: ['🐶' '🦁' '😍' '👽' '😎']
Key 2: ['😂' '😱' '🤯' '🍕' '🎉']
Key 3: ['🙃' '😇' '🤖' '🐸' '😴']
Key 4: ['🌟' '🥳' '🔥' '🥰' '🐙']
- Note left of User: User icons: ['😍' '🤓' '😇' '😡']
- User->>Client: Key Selection: [1, 0, 3, 0]
- Client->>+Server: Confirm nKode:
92a2a1c6-3146-4d47-ac00-5160a7ebf104
[1, 0, 3, 0]
+ Note left of Client: Key 0: ['🥺' '😡' '😱' '👽' '👾']
Key 1: ['😀' '🙃' '🥳' '🐸' '😎']
Key 2: ['🦄' '🐶' '😇' '🍕' '🐙']
Key 3: ['🐱' '😂' '⚡' '🥰' '🎉']
Key 4: ['🤔' '🌟' '🦁' '🤓' '😴']
+ Note left of User: User icons: ['🐱' '🥳' '🐶' '⚡']
+ User->>Client: Key Selection: [3, 1, 2, 3]
+ Client->>+Server: Confirm nKode:
e029138e-fb64-49ea-a6bc-b6b5affbf263
[3, 1, 2, 3]
Server->>Server: Create User
- Server-->-Client: Success
+ Server-->>-Client: Success
```
\ No newline at end of file
diff --git a/docs/enrollment_diagram.template.md b/docs/enrollment_diagram.template.md
index e2c239c..50c06c7 100644
--- a/docs/enrollment_diagram.template.md
+++ b/docs/enrollment_diagram.template.md
@@ -4,17 +4,17 @@ sequenceDiagram
participant User
participant Client
participant Server
- Note over User,Client: Enrollment
+ Note over User,Server: Enrollment
Client->>User: Signup Form
Note left of User: email: {{ email }}
User->>Client: Submit Email
Client->>+Server: Signup Session: {{ email }}
Server->>Server: Create Signup Session
- Note over User,Client: Set nKode
+ Note over User,Server: Set nKode
Server-->>-Client: signup_session_id, set_keypad, icons
Note left of Server: signup_session_id:
{{ signup_session_id }}
Note left of Server: set_keypad:
{{set_keypad}}
- Note left of Server: Icons:
{{icon_matrix}}
+ Note left of Server: Icons:
{{keypad_icons}}
Client->>Client: Order Icons by keypad
Client->>User: Display Keypad
Note left of Client: {{ ordered_keypad }}
@@ -22,7 +22,7 @@ sequenceDiagram
User->>Client: Set Key Selection: {{ selected_keys_set }}
Client->>+Server: Set nKode:
{{ signup_session_id }}
{{ selected_keys_set }}
Server->>Server: Disperse Set Keypad
- Note over User,Client: Confirm nKode
+ Note over User,Server: Confirm nKode
Server-->>-Client: signup_session_id, confirm_keypad, icons
Note left of Server: signup_session_id:
{{ signup_session_id }}
Note left of Server: confirm_keypad:
{{confirm_keypad}}
@@ -33,5 +33,5 @@ sequenceDiagram
User->>Client: Key Selection: {{ confirm_key_selection }}
Client->>+Server: Confirm nKode:
{{ signup_session_id }}
{{ confirm_key_selection }}
Server->>Server: Create User
- Server-->-Client: Success
+ Server-->>-Client: Success
```
\ No newline at end of file
diff --git a/docs/login_diagram.md b/docs/login_diagram.md
new file mode 100644
index 0000000..b1e4506
--- /dev/null
+++ b/docs/login_diagram.md
@@ -0,0 +1,22 @@
+# nKode Login
+
+```mermaid
+sequenceDiagram
+ participant User
+ participant Client
+ participant Server
+ Note over User,Server: Login
+ Client->>User: Login Form
+ Note left of User: email: user@example.com
+ User->>Server: Submit Email
+ Server->>Client: login_keypad, icons
+ Note left of Server: Login Keypad:
Key 0: [18 7 20 27 22 23]
Key 1: [12 13 8 3 28 29]
Key 2: [24 25 26 9 16 5]
Key 3: [ 6 19 2 21 10 11]
Key 4: [ 0 1 14 15 4 17]
+ Note left of Server: Icons:
[😀,😂,🥳,😍,🤓
😎,🥺,😡,😱,🤯
🥰,😴,🤔,🙃,😇
🤖,👽,👾,🐱,🐶
🦁,🐻,🐸,🐙,🦄
🌟,⚡,🔥,🍕,🎉]
+ Client->>Client: Order Icons
+ Client->>User: Display Keypad
+ Note left of Client: Key 0: ['🐱' '😡' '🦁' '🔥' '🐸' '🐙']
Key 1: ['🤔' '🙃' '😱' '😍' '🍕' '🎉']
Key 2: ['🦄' '🌟' '⚡' '🤯' '👽' '😎']
Key 3: ['🥺' '🐶' '🥳' '🐻' '🥰' '😴']
Key 4: ['😀' '😂' '😇' '🤖' '🤓' '👾']
+ Note left of User: User passcode icons: ['🐱' '🥳' '🐶' '⚡']
+ User->>Client: Selected Keys
[0, 3, 3, 2]
+ Client->>Server: Login:
email: user@example.com
selected_keys: [0, 3, 3, 2]
+ Server-->>Client: Success
+```
\ No newline at end of file
diff --git a/docs/login_diagram.template.md b/docs/login_diagram.template.md
new file mode 100644
index 0000000..ba5ad57
--- /dev/null
+++ b/docs/login_diagram.template.md
@@ -0,0 +1,22 @@
+# nKode Login
+
+```mermaid
+sequenceDiagram
+ participant User
+ participant Client
+ participant Server
+ Note over User,Server: Login
+ Client->>User: Login Form
+ Note left of User: email: {{ email }}
+ User->>Server: Submit Email
+ Server->>Client: login_keypad, icons
+ Note left of Server: Login Keypad:
{{ login_keypad }}
+ Note left of Server: Icons:
{{ keypad_icons }}
+ Client->>Client: Order Icons
+ Client->>User: Display Keypad
+ Note left of Client: {{ ordered_login_icons }}
+ Note left of User: User passcode icons: {{ passcode_user_icons }}
+ User->>Client: Selected Keys
{{selected_keys_login}}
+ Client->>Server: Login:
email: {{email}}
selected_keys: {{selected_keys_login}}
+ Server-->>Client: Success
+```
diff --git a/docs/render_enrollment_md.py b/docs/render_diagrams_md.py
similarity index 72%
rename from docs/render_enrollment_md.py
rename to docs/render_diagrams_md.py
index e5e7221..6696a5c 100644
--- a/docs/render_enrollment_md.py
+++ b/docs/render_diagrams_md.py
@@ -47,9 +47,9 @@ def display_icons(icons_array: np.ndarray, kp: KeypadSize) -> str:
icons += "]"
return icons
-def display_icons_keypad(icons_array: np.ndarray, kp: KeypadSize) -> str:
+def display_icons_keypad(icons_array: np.ndarray, props_per_key: int) -> str:
icons = ""
- for idx, row in enumerate(icons_array.reshape(-1, kp.numb_of_keys)):
+ for idx, row in enumerate(icons_array.reshape(-1, props_per_key)):
icons += f"Key {idx}: "
icons += str(row)
icons += "
"
@@ -93,15 +93,27 @@ if __name__ == "__main__":
context = {
"email": "user@example.com",
"signup_session_id": signup_session_id,
- "set_keypad": display_icons_keypad(set_signup_keypad.reshape(-1, keypad_size.numb_of_keys), keypad_size),
- "icon_matrix": display_icons(user_icons, keypad_size),
- "ordered_keypad": display_icons_keypad(ordered_set_icons, keypad_size),
+ "set_keypad": display_icons_keypad(set_signup_keypad.reshape(-1, keypad_size.numb_of_keys), keypad_size.numb_of_keys),
+ "keypad_icons": display_icons(user_icons, keypad_size),
+ "ordered_keypad": display_icons_keypad(ordered_set_icons, keypad_size.numb_of_keys),
"passcode_user_icons": str(user_icons[passcode_property_indices]),
"selected_keys_set": str(selected_keys_set),
- "confirm_keypad": display_icons_keypad(confirm_keypad.reshape(-1, keypad_size.numb_of_keys), keypad_size),
- "confirm_ordered_keypad": display_icons_keypad(ordered_confirm_icons.reshape(-1, keypad_size.numb_of_keys), keypad_size),
+ "confirm_keypad": display_icons_keypad(confirm_keypad.reshape(-1, keypad_size.numb_of_keys), keypad_size.numb_of_keys),
+ "confirm_ordered_keypad": display_icons_keypad(ordered_confirm_icons.reshape(-1, keypad_size.numb_of_keys), keypad_size.numb_of_keys),
"confirm_key_selection": selected_keys_confirm
}
-
- # Render the template
- render_markdown_template(Path("./enrollment_diagram.template.md"), Path("./enrollment_diagram.md"), context)
\ No newline at end of file
+ render_markdown_template(Path("./enrollment_diagram.template.md"), Path("./enrollment_diagram.md"), context)
+ login_keypad = api.get_login_keypad(username, customer_id)
+ selected_keys_login = select_keys_with_passcode_values(passcode_property_indices, login_keypad,
+ keypad_size.props_per_key)
+ ordered_login_keypad = user_icons[login_keypad]
+ context = {
+ "email": "user@example.com",
+ "keypad_icons": display_icons(user_icons, keypad_size),
+ "login_keypad": display_icons_keypad(login_keypad.reshape(-1, keypad_size.props_per_key), keypad_size.props_per_key),
+ "ordered_login_icons": display_icons_keypad(ordered_login_keypad.reshape(-1, keypad_size.props_per_key),keypad_size.props_per_key),
+ "passcode_user_icons": str(user_icons[passcode_property_indices]),
+ "selected_keys_login": str(selected_keys_login)
+ }
+ api.login(customer_id, username, selected_keys_login)
+ render_markdown_template(Path("./login_diagram.template.md"), Path("./login_diagram.md"), context)