diff --git a/flowapp/__about__.py b/flowapp/__about__.py
index be0f7d4..59b7f43 100755
--- a/flowapp/__about__.py
+++ b/flowapp/__about__.py
@@ -1 +1 @@
-__version__ = "0.7.3"
+__version__ = "0.8.0"
diff --git a/flowapp/forms.py b/flowapp/forms.py
index 3cf3555..ae83a1e 100644
--- a/flowapp/forms.py
+++ b/flowapp/forms.py
@@ -138,6 +138,32 @@ class ApiKeyForm(FlaskForm):
key = HiddenField("GeneratedKey")
+class MachineApiKeyForm(FlaskForm):
+ """
+ ApiKey for Machines
+ Each key / machine pair is unique
+ Only Admin can create new these keys
+ """
+
+ machine = StringField(
+ "Machine address",
+ validators=[DataRequired(), IPAddress(message="provide valid IP address")],
+ )
+
+ comment = TextAreaField(
+ "Your comment for this key", validators=[Optional(), Length(max=255)]
+ )
+
+ expires = MultiFormatDateTimeLocalField(
+ "Key expiration. Leave blank for non expring key (not-recomended).",
+ format=FORM_TIME_PATTERN, validators=[Optional()], unlimited=True
+ )
+
+ readonly = BooleanField("Read only key", default=False)
+
+ key = HiddenField("GeneratedKey")
+
+
class OrganizationForm(FlaskForm):
"""
Organization form object
diff --git a/flowapp/instance_config.py b/flowapp/instance_config.py
index 3c8bafb..9d5a1bf 100644
--- a/flowapp/instance_config.py
+++ b/flowapp/instance_config.py
@@ -78,6 +78,7 @@ class InstanceConfig:
],
"admin": [
{"name": "Commands Log", "url": "admin.log"},
+ {"name": "Machine keys", "url": "admin.machine_keys"},
{
"name": "Users",
"url": "admin.users",
diff --git a/flowapp/templates/forms/machine_api_key.html b/flowapp/templates/forms/machine_api_key.html
new file mode 100644
index 0000000..be6fcaa
--- /dev/null
+++ b/flowapp/templates/forms/machine_api_key.html
@@ -0,0 +1,44 @@
+{% extends 'layouts/default.html' %}
+{% from 'forms/macros.html' import render_field, render_checkbox_field %}
+{% block title %}Add New Machine with ApiKey{% endblock %}
+{% block content %}
+
Add new ApiKey for machine.
+
+ In general, the keys should be Read Only and with expiration.
+ If you need to create a full access Read/Write key, consider using usual user form
+ with your organization settings.
+
+
+
+
+
+
Machine Api Key: {{ generated_key }}
+
+
+
+
+
+ {{ render_field(form.comment) }}
+
+
+
+
+
+
+
+
+{% endblock %}
\ No newline at end of file
diff --git a/flowapp/templates/pages/api_key.html b/flowapp/templates/pages/api_key.html
index 2532d91..cc64588 100644
--- a/flowapp/templates/pages/api_key.html
+++ b/flowapp/templates/pages/api_key.html
@@ -19,7 +19,7 @@
Your machines and ApiKeys
{{ row.key }}
- {{ row.expires }}
+ {{ row.expires|strftime }}
{% if row.readonly %}
diff --git a/flowapp/templates/pages/machine_api_key.html b/flowapp/templates/pages/machine_api_key.html
new file mode 100644
index 0000000..52eb478
--- /dev/null
+++ b/flowapp/templates/pages/machine_api_key.html
@@ -0,0 +1,55 @@
+{% extends 'layouts/default.html' %}
+{% block title %}ExaFS - ApiKeys{% endblock %}
+{% block content %}
+
Machines and ApiKeys
+
+ This is the list of all machines and their API keys, created by admin(s).
+ In general, the keys should be Read Only and with expiration.
+ If you need to create a full access Read/Write key, use usual user form with your organization settings.
+