pravega / pravega-operator

Pravega Kubernetes Operator
Apache License 2.0
41 stars 38 forks source link

Issue 611: Adding validation for authentication settings #612

Closed anishakj closed 2 years ago

anishakj commented 2 years ago

Signed-off-by: anishakj anisha.kj@dell.com

Change log description

Adding validation for authentication settings

Purpose of the change

Fixes #611

What the code does

If authentication is enabled, webhook validation will ensure a. Pravega.Options["autoScale.controller.connect.security.auth.enable"]/p.Spec.Pravega.Options["autoScale.authEnabled"] is set to true b. controller.security.auth.delegationToken.signingKey.basis is present c. autoScale.security.auth.token.signingKey.basis is present d. b and c are equal

If authentication is disabled. validation will ensure Pravega.Options["autoScale.controller.connect.security.auth.enable"]/p.Spec.Pravega.Options["autoScale.authEnabled"] is set to false

How to verify it

Verified by setting these options and installed pravega and saw that proper error message is displayed.

codecov-commenter commented 2 years ago

Codecov Report

Merging #612 (2715312) into master (2a93740) will increase coverage by 0.08%. The diff coverage is 84.61%.

@@            Coverage Diff             @@
##           master     #612      +/-   ##
==========================================
+ Coverage   75.01%   75.09%   +0.08%     
==========================================
  Files          16       16              
  Lines        4486     4525      +39     
==========================================
+ Hits         3365     3398      +33     
- Misses        987      993       +6     
  Partials      134      134              
Impacted Files Coverage Δ
pkg/apis/pravega/v1beta1/pravegacluster_types.go 35.36% <84.61%> (+2.06%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 2a93740...2715312. Read the comment docs.