From 0344ccb1aa1bda02cd3ef7291491c5ab8349c289 Mon Sep 17 00:00:00 2001 From: Jack Lucas Date: Thu, 27 Jul 2023 11:20:40 -0400 Subject: Shorten ON-BEHALF-OF default name. The provisioning server truncates the ON-BEHALF-OF name to 8 characters when storing the owner of a feed or subscription. Previous default name was longer than 8 characters. Shortened to "drprovcl". Issue-ID: DMAAP-1893 Signed-off-by: Jack Lucas Change-Id: I846d9e44659f1ca1c0a14ba930dab147aa2608c6 --- datarouter-prov-client/README.md | 25 +++++++++++++++++++++++++ datarouter-prov-client/misc/drprov-client.sh | 20 +++++++++++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/datarouter-prov-client/README.md b/datarouter-prov-client/README.md index b7e35b28..38857f53 100644 --- a/datarouter-prov-client/README.md +++ b/datarouter-prov-client/README.md @@ -1,3 +1,22 @@ + # Data Router provisioning client ## Overview @@ -55,6 +74,12 @@ The bus controller also had a notion of "location" which has no corresponding no ### Owner The bus controller interface included a field called "owner" for a feed. This may have had some function within the bus controller. It had a minor effect on the bus controller's invocation of the DR provisioning API (setting the `X-DMAAP-DR-ON-BEHALF-OF` header in the API requests associated with the feed). It adds no real value. Maintaining it would add complexity to the drprov-client script and would complicate debugging DR provisioning issues. +Note that the drprov-client.sh script uses "drprovcl" by default as the value in the `X-DMAAP-DR-ON-BEHALF-OF`. This can be overriden by setting the environment +variable `ONBEHALFHDR` in the [common DMaaP provisioning template](https://git.onap.org/oom/tree/kubernetes/common/common/templates/_dmaapProvisioning.tpl). + +`X-DMAAP-DR-ON-BEHALF-OF` forms the basis of a simple authorization mechanism used by the DR provisioning API. The value passed in this header when creating a +feed or a subscription is stored by the DR provisioning server. When the DR API receives a request to retrieve the data for a specific feed or a specific subscription, the API checks that the value in the `X-DMAAP-DR-ON-BEHALF-OF` header in the incoming request matches the stored value for the target feed or subscription. Sometimes during testing or debugging, it is useful to query the DR provisioning API about a specific feed or subscription using a tool like `curl`. Using `X-DMAAP-DR-ON-BEHALF-OF: drprovcl` will allow access to the feeds and subscription created by the drprov-client.sh script. + ### Classification The bus controller interface included a field called "asprClassification" for a feed. The field is required by DR and indicates the sensitivity of the information transmitted in a feed. This has not been used in ONAP, but it is a required field. "aspr" is an internal acronym at the company where DR was originally developed. The field has been renamed "classification". "unclassified" is a reasonable value to use in ONAP. diff --git a/datarouter-prov-client/misc/drprov-client.sh b/datarouter-prov-client/misc/drprov-client.sh index 71017954..844911e4 100755 --- a/datarouter-prov-client/misc/drprov-client.sh +++ b/datarouter-prov-client/misc/drprov-client.sh @@ -1,8 +1,26 @@ #!/bin/sh +# +# ============LICENSE_START=============================================== +# org.onap.dmaap +# ======================================================================== +# Copyright (c) J. F. Lucas. All rights reserved. +# # ======================================================================== +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END================================================= PROVURL=${PROVURL:-"http://dmaap-dr-prov:8080"} DRCONFIGDIR=${DRCONFIGDIR:-"/opt/app/config"} -ONBEHALFHDR="X-DMAAP-DR-ON-BEHALF-OF: drprovclient" +ONBEHALFHDR="X-DMAAP-DR-ON-BEHALF-OF: drprovcl" FEEDTYPE="Content-Type: application/vnd.dmaap-dr.feed" SUBTYPE="Content-Type: application/vnd.dmaap-dr.subscription" APPCONFIGINPUT=${APPCONFIGINPUT:-"/config-input"} -- cgit 1.2.3-korg