Skip to content

Commit

Permalink
Enable Onvif discovery handler authenticated discovery (#638)
Browse files Browse the repository at this point in the history
* Enable Onvif discovery handler authenticated discovery

Signed-off-by: Johnson Shih <jshih@microsoft.com>

* update credential data key format

Signed-off-by: Johnson Shih <jshih@microsoft.com>

* discoveryProperties helm support

Signed-off-by: Johnson Shih <jshih@microsoft.com>

* Add default credential support

Signed-off-by: Johnson Shih <jshih@microsoft.com>

* remove base64encoded default setter

Signed-off-by: Johnson Shih <jshih@microsoft.com>

* Add comment for username token profile

Signed-off-by: Johnson Shih <jshih@microsoft.com>

* refactor default_credential

Signed-off-by: Johnson Shih <jshih@microsoft.com>

* update patch version

Signed-off-by: Johnson Shih <jshih@microsoft.com>

---------

Signed-off-by: Johnson Shih <jshih@microsoft.com>
  • Loading branch information
johnsonshih authored Aug 9, 2023
1 parent 18f7dd4 commit 4b60822
Show file tree
Hide file tree
Showing 25 changed files with 948 additions and 71 deletions.
31 changes: 17 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion agent/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "agent"
version = "0.12.1"
version = "0.12.2"
authors = ["Kate Goldenring <kate.goldenring@microsoft.com>", "<bfjelds@microsoft.com>"]
edition = "2018"
rust-version = "1.68.1"
Expand Down
2 changes: 1 addition & 1 deletion controller/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "controller"
version = "0.12.1"
version = "0.12.2"
authors = ["<bfjelds@microsoft.com>", "<kagold@microsoft.com>"]
edition = "2018"
rust-version = "1.68.1"
Expand Down
4 changes: 2 additions & 2 deletions deployment/helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.12.1
version: 0.12.2

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 0.12.1
appVersion: 0.12.2
36 changes: 36 additions & 0 deletions deployment/helm/templates/onvif-configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,42 @@ spec:
items: []
{{- end }}
discoveryTimeoutSeconds: {{ .Values.onvif.configuration.discoveryDetails.discoveryTimeoutSeconds }}
{{- if .Values.onvif.configuration.discoveryProperties}}
discoveryProperties:
{{- range $property := .Values.onvif.configuration.discoveryProperties }}
- name: {{ $property.name }}
{{- if $property.valueFrom }}
valueFrom:
{{- if $property.valueFrom.secretKeyRef }}
secretKeyRef:
name: {{ $property.valueFrom.secretKeyRef.name }}
{{- if $property.valueFrom.secretKeyRef.namespace }}
namespace: {{ $property.valueFrom.secretKeyRef.namespace }}
{{- end }}
{{- if $property.valueFrom.secretKeyRef.key }}
key: {{ $property.valueFrom.secretKeyRef.key }}
{{- end }}
{{- if hasKey $property.valueFrom.secretKeyRef "optional" }}
optional: {{ $property.valueFrom.secretKeyRef.optional }}
{{- end }}
{{- else if $property.valueFrom.configMapKeyRef}}
configMapKeyRef:
name: {{ $property.valueFrom.configMapKeyRef.name }}
{{- if $property.valueFrom.configMapKeyRef.namespace }}
namespace: {{ $property.valueFrom.configMapKeyRef.namespace }}
{{- end }}
{{- if $property.valueFrom.configMapKeyRef.key }}
key: {{ $property.valueFrom.configMapKeyRef.key }}
{{- end }}
{{- if hasKey $property.valueFrom.configMapKeyRef "optional" }}
optional: {{ $property.configMapKeyRef.optional }}
{{- end }}
{{- end }}
{{- else }}
value: {{ $property.value | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- if or .Values.onvif.configuration.brokerPod.image.repository .Values.onvif.configuration.brokerJob.image.repository }}
{{- /* Only add brokerSpec if a broker image is provided */}}
brokerSpec:
Expand Down
3 changes: 3 additions & 0 deletions deployment/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,9 @@ onvif:
action: Exclude
items: []
discoveryTimeoutSeconds: 1
# discoveryProperties is a map of properties fthat will be passed to discovery handler,
# the properties can be direct specified or read from Secret or ConfigMap
discoveryProperties:
# capacity is the capacity for any instances created as a result of
# applying this onvif configuration
capacity: 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "debug-echo-discovery-handler"
version = "0.12.1"
version = "0.12.2"
authors = ["Kate Goldenring <kate.goldenring@microsoft.com>"]
edition = "2018"
rust-version = "1.68.1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "onvif-discovery-handler"
version = "0.12.1"
version = "0.12.2"
authors = ["Kate Goldenring <kate.goldenring@microsoft.com>"]
edition = "2018"
rust-version = "1.68.1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "opcua-discovery-handler"
version = "0.12.1"
version = "0.12.2"
authors = ["Kate Goldenring <kate.goldenring@microsoft.com>"]
edition = "2018"
rust-version = "1.68.1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "udev-discovery-handler"
version = "0.12.1"
version = "0.12.2"
authors = ["Kate Goldenring <kate.goldenring@microsoft.com>"]
edition = "2018"
rust-version = "1.68.1"
Expand Down
2 changes: 1 addition & 1 deletion discovery-handlers/debug-echo/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "akri-debug-echo"
version = "0.12.1"
version = "0.12.2"
authors = ["Kate Goldenring <kate.goldenring@microsoft.com>"]
edition = "2018"
rust-version = "1.68.1"
Expand Down
5 changes: 4 additions & 1 deletion discovery-handlers/onvif/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "akri-onvif"
version = "0.12.1"
version = "0.12.2"
authors = ["Kate Goldenring <kate.goldenring@microsoft.com>"]
edition = "2018"
rust-version = "1.68.1"
Expand All @@ -12,7 +12,9 @@ akri-discovery-utils = { path = "../../discovery-utils" }
akri-shared = { path = "../../shared" }
anyhow = "1.0.38"
async-trait = "0.1.0"
base64 = "0.13.1"
bytes = "1.0.1"
chrono = "0.4.10"
env_logger = "0.10.0"
futures-util = "0.3"
hyper = { version = "0.14.11", package = "hyper" }
Expand All @@ -21,6 +23,7 @@ serde = "1.0.104"
serde_json = "1.0.45"
serde_yaml = "0.8.11"
serde_derive = "1.0.104"
sha1 = "0.6.1"
sxd-document = "0.3.0"
sxd-xpath = "0.4.0"
tokio = { version = "1.0", features = ["time", "net", "sync"] }
Expand Down
Loading

0 comments on commit 4b60822

Please sign in to comment.