summaryrefslogtreecommitdiff
path: root/static/redfish/v1
diff options
context:
space:
mode:
authorKowalski, Kamil <kamil.kowalski@intel.com>2019-07-12 10:59:11 +0300
committerJames Feist <james.feist@linux.intel.com>2019-10-31 20:13:42 +0300
commit0ff64dc2cd3a15b4204a477ad2eb5219d66e6110 (patch)
tree0c3b71bdde4615e2e38a5dd230c53719ac3ee5b6 /static/redfish/v1
parentfc41ff6e941a1052a45c47a1de9568219b387283 (diff)
downloadbmcweb-0ff64dc2cd3a15b4204a477ad2eb5219d66e6110.tar.xz
Auth methods configuration
Added Oem extension for AccountService allowing user to configure which authentication methods should be enabled. User is now able to turn on and off authentication methods like BasicAuth, XToken, etc. User is not allowed to turn off all of the methods at once - at least one method has to be active to prevent lock-out. This configuration is persistent, will be saved on file-system and will be loaded on bmcweb's restart. Tested: No regression found in manual testing. By default everything works as before, and disabling auth method prevents user to authenticate by it. Tested that user is not allowed to disable all the methods - either in one PATCH or by disabling them one at a time. ServiceValidator run with success. Change-Id: I3a775d783ac05998d17b8e91800962bffd8cab52 Signed-off-by: Kowalski, Kamil <kamil.kowalski@intel.com> Signed-off-by: Zbigniew Kurzynski <zbigniew.kurzynski@intel.com>
Diffstat (limited to 'static/redfish/v1')
-rw-r--r--static/redfish/v1/$metadata/index.xml4
-rw-r--r--static/redfish/v1/JsonSchemas/OemAccountService/index.json102
-rw-r--r--static/redfish/v1/schema/OemAccountService.xml71
3 files changed, 177 insertions, 0 deletions
diff --git a/static/redfish/v1/$metadata/index.xml b/static/redfish/v1/$metadata/index.xml
index 73833652d7..4804e48024 100644
--- a/static/redfish/v1/$metadata/index.xml
+++ b/static/redfish/v1/$metadata/index.xml
@@ -1045,6 +1045,10 @@
<edmx:Include Namespace="NetworkPort.v1_2_2"/>
<edmx:Include Namespace="NetworkPort.v1_2_3"/>
</edmx:Reference>
+ <edmx:Reference Uri="/redfish/v1/schema/OemAccountService_v1.xml">
+ <edmx:Include Namespace="OemAccountService"/>
+ <edmx:Include Namespace="OemAccountService.v1_0_0"/>
+ </edmx:Reference>
<edmx:Reference Uri="/redfish/v1/schema/NetworkPortCollection_v1.xml">
<edmx:Include Namespace="NetworkPortCollection"/>
</edmx:Reference>
diff --git a/static/redfish/v1/JsonSchemas/OemAccountService/index.json b/static/redfish/v1/JsonSchemas/OemAccountService/index.json
new file mode 100644
index 0000000000..528317086c
--- /dev/null
+++ b/static/redfish/v1/JsonSchemas/OemAccountService/index.json
@@ -0,0 +1,102 @@
+{
+ "$id": "http://redfish.dmtf.org/schemas/v1/OemAccountService.v1_0_0.json",
+ "$schema": "http://redfish.dmtf.org/schemas/v1/redfish-schema-v1.json",
+ "copyright": "Copyright 2014-2019 DMTF. For the full DMTF copyright policy, see http://www.dmtf.org/about/policies/copyright",
+ "definitions": {
+ "AccountService": {
+ "additionalProperties": false,
+ "description": "OEM Extension for AccountService",
+ "longDescription": "OEM Extension for AccountService providing info about TLS Auth.",
+ "patternProperties": {
+ "^([a-zA-Z_][a-zA-Z0-9_]*)?@(odata|Redfish|Message)\\.[a-zA-Z_][a-zA-Z0-9_]*$": {
+ "description": "This property shall specify a valid odata or Redfish property.",
+ "type": [
+ "array",
+ "boolean",
+ "integer",
+ "number",
+ "null",
+ "object",
+ "string"
+ ]
+ }
+ },
+ "properties": {
+ "AuthMethods": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AuthMethodsConfig"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Authorization Methods configuration.",
+ "longDescription": "Configuration describing which auth methods are enabled."
+ }
+ },
+ "type": "object"
+ },
+ "AuthMethodsConfig": {
+ "additionalProperties": false,
+ "description": "Authorization Methods configuration.",
+ "longDescription": "Configuration describing which auth methods are enabled.",
+ "patternProperties": {
+ "^([a-zA-Z_][a-zA-Z0-9_]*)?@(odata|Redfish|Message)\\.[a-zA-Z_][a-zA-Z0-9_]*$": {
+ "description": "This property shall specify a valid odata or Redfish property.",
+ "type": [
+ "array",
+ "boolean",
+ "integer",
+ "number",
+ "null",
+ "object",
+ "string"
+ ]
+ }
+ },
+ "properties": {
+ "BasicAuth": {
+ "description": "Indicates whether BasicAuth authorization is enabled.",
+ "longDescription": "The value of this property shall be a boolean indicating whether BasicAuth authorization is enabled.",
+ "readonly": false,
+ "type": [
+ "boolean",
+ "null"
+ ]
+ },
+ "Cookie": {
+ "description": "Indicates whether Cookie authorization is enabled.",
+ "longDescription": "The value of this property shall be a boolean indicating whether Cookie authorization is enabled.",
+ "readonly": false,
+ "type": [
+ "boolean",
+ "null"
+ ]
+ },
+ "SessionToken": {
+ "description": "Indicates whether SessionToken authorization is enabled.",
+ "longDescription": "The value of this property shall be a boolean indicating whether SessionToken authorization is enabled.",
+ "readonly": false,
+ "type": [
+ "boolean",
+ "null"
+ ]
+ },
+ "XToken": {
+ "description": "Indicates whether XToken authorization is enabled.",
+ "longDescription": "The value of this property shall be a boolean indicating whether XToken authorization is enabled.",
+ "readonly": false,
+ "type": [
+ "boolean",
+ "null"
+ ]
+ }
+ },
+ "type": "object"
+ }
+ },
+ "owningEntity": "OpenBMC",
+ "release": "1.0",
+ "title": "#OemAccountService.v1_0_0"
+} \ No newline at end of file
diff --git a/static/redfish/v1/schema/OemAccountService.xml b/static/redfish/v1/schema/OemAccountService.xml
new file mode 100644
index 0000000000..626097b3c8
--- /dev/null
+++ b/static/redfish/v1/schema/OemAccountService.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Version="4.0">
+
+ <edmx:Reference Uri="http://docs.oasis-open.org/odata/odata/v4.0/errata03/csd01/complete/vocabularies/Org.OData.Core.V1.xml">
+ <edmx:Include Namespace="Org.OData.Core.V1" Alias="OData"/>
+ </edmx:Reference>
+ <edmx:Reference Uri="http://docs.oasis-open.org/odata/odata/v4.0/errata03/csd01/complete/vocabularies/Org.OData.Measures.V1.xml">
+ <edmx:Include Namespace="Org.OData.Measures.V1" Alias="Measures"/>
+ </edmx:Reference>
+ <edmx:Reference Uri="http://redfish.dmtf.org/schemas/v1/RedfishExtensions_v1.xml">
+ <edmx:Include Namespace="RedfishExtensions.v1_0_0" Alias="Redfish"/>
+ </edmx:Reference>
+ <edmx:Reference Uri="http://redfish.dmtf.org/schemas/v1/Resource_v1.xml">
+ <edmx:Include Namespace="Resource"/>
+ <edmx:Include Namespace="Resource.v1_0_0"/>
+ </edmx:Reference>
+
+ <edmx:DataServices>
+
+ <Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="OemAccountService">
+ <Annotation Term="Redfish.OwningEntity" String="OpenBMC"/>
+ </Schema>
+
+ <Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="OemAccountService.v1_0_0">
+ <Annotation Term="Redfish.OwningEntity" String="OpenBMC"/>
+ <Annotation Term="Redfish.Release" String="1.0"/>
+
+ <ComplexType Name="AuthMethodsConfig">
+ <Annotation Term="OData.AdditionalProperties" Bool="false"/>
+ <Annotation Term="OData.Description" String="Authorization Methods configuration."/>
+ <Annotation Term="OData.LongDescription" String="Configuration describing which auth methods are enabled."/>
+
+ <Property Name="BasicAuth" Type="Edm.Boolean">
+ <Annotation Term="OData.Permissions" EnumMember="OData.Permission/ReadWrite"/>
+ <Annotation Term="OData.Description" String="Indicates whether BasicAuth authorization is enabled."/>
+ <Annotation Term="OData.LongDescription" String="The value of this property shall be a boolean indicating whether BasicAuth authorization is enabled."/>
+ </Property>
+
+ <Property Name="Cookie" Type="Edm.Boolean">
+ <Annotation Term="OData.Permissions" EnumMember="OData.Permission/ReadWrite"/>
+ <Annotation Term="OData.Description" String="Indicates whether Cookie authorization is enabled."/>
+ <Annotation Term="OData.LongDescription" String="The value of this property shall be a boolean indicating whether Cookie authorization is enabled."/>
+ </Property>
+
+ <Property Name="SessionToken" Type="Edm.Boolean">
+ <Annotation Term="OData.Permissions" EnumMember="OData.Permission/ReadWrite"/>
+ <Annotation Term="OData.Description" String="Indicates whether SessionToken authorization is enabled."/>
+ <Annotation Term="OData.LongDescription" String="The value of this property shall be a boolean indicating whether SessionToken authorization is enabled."/>
+ </Property>
+
+ <Property Name="XToken" Type="Edm.Boolean">
+ <Annotation Term="OData.Permissions" EnumMember="OData.Permission/ReadWrite"/>
+ <Annotation Term="OData.Description" String="Indicates whether XToken authorization is enabled."/>
+ <Annotation Term="OData.LongDescription" String="The value of this property shall be a boolean indicating whether XToken authorization is enabled."/>
+ </Property>
+ </ComplexType>
+
+ <!--Base entity type for array members-->
+ <EntityType Name="AccountService" BaseType="Resource.OemObject" Abstract="true">
+ <Annotation Term="OData.Description" String="OEM Extension for AccountService"/>
+ <Annotation Term="OData.LongDescription" String="OEM Extension for AccountService providing info about TLS Auth."/>
+
+ <Property Name="AuthMethods" Type="OemAccountService.v1_0_0.AuthMethodsConfig">
+ <Annotation Term="OData.Description" String="Authorization Methods configuration."/>
+ <Annotation Term="OData.LongDescription" String="Configuration describing which auth methods are enabled."/>
+ </Property>
+ </EntityType>
+ </Schema>
+
+ </edmx:DataServices>
+</edmx:Edmx>