Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve OpenID auth handling on not_openid response #5952

Merged
merged 1 commit into from
Oct 3, 2024

Conversation

b10n1k
Copy link
Contributor

@b10n1k b10n1k commented Sep 26, 2024

Enhanced error handling by including OpenID provider URI in error messages for
invalid data. The error seems sporadic and as part of the research on
https://progress.opensuse.org/issues/167266 we can consider this not a severe
problem. Because of the sensitivity of the arguments, it is not feasible to
add any info from the available data for later debbugging. But at least now
we can tell which server cause problems.

Martchus

This comment was marked as resolved.

@b10n1k b10n1k force-pushed the 167266_not_openid branch 2 times, most recently from 06f453e to 76f7884 Compare September 26, 2024 17:10
@b10n1k

This comment was marked as resolved.

Copy link

codecov bot commented Sep 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.76%. Comparing base (7a5fed2) to head (8ce5afe).
Report is 13 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5952   +/-   ##
=======================================
  Coverage   98.75%   98.76%           
=======================================
  Files         396      396           
  Lines       38983    38991    +8     
=======================================
+ Hits        38499    38510   +11     
+ Misses        484      481    -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

okurz

This comment was marked as resolved.

@b10n1k

This comment was marked as resolved.

@b10n1k

This comment was marked as resolved.

@b10n1k

This comment was marked as resolved.

@b10n1k b10n1k force-pushed the 167266_not_openid branch 7 times, most recently from 7d75325 to 4e21c9d Compare September 30, 2024 10:57
t/03-auth-openid.t Outdated Show resolved Hide resolved
t/03-auth-openid.t Outdated Show resolved Hide resolved
t/03-auth-openid.t Outdated Show resolved Hide resolved
lib/OpenQA/WebAPI/Auth/OpenID.pm Outdated Show resolved Hide resolved
@okurz

This comment was marked as resolved.

@b10n1k b10n1k force-pushed the 167266_not_openid branch 2 times, most recently from 737dd8c to fcc5b2d Compare October 1, 2024 14:20
Enhanced error handling by including OpenID provider URI in error messages for
invalid data. The error seems sporadic and as part of the research on
https://progress.opensuse.org/issues/167266 we can consider this not a severe
problem. Because of the sensitivity of the arguments, it is not feasible to
add any info from the available data for later debbugging. But at least now
we can tell which server cause problems.

Signed-off-by: Ioannis Bonatakis <[email protected]>
@b10n1k b10n1k changed the title Decrease not_openid log level and provide an better explaination Improve OpenID auth handling on not_openid response Oct 2, 2024
Comment on lines +47 to +53
$c->set_always(
req => Test::MockObject->new->set_always(
params => Test::MockObject->new->set_always(pairs => ['openid.op_endpoint', 'https://www.opensuse.org/openid/'])
)->set_always(url => Test::MockObject->new->set_always(base => 'openqa')))
->set_always(
app => Test::MockObject->new->set_always(config => {})->set_always(log => Test::MockObject->new->set_true('debug')))
->set_true('flash');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you reduce the duplication here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried. but I didnt find a way. I couldnt just change the set_always(log => Test::MockObject->new->set_true('debug'))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can leave it as it was but this was confusing to me. tests produces positive negatives. for instance:
if I replace error with debug in https://github.com/os-autoinst/openQA/pull/5952/files#diff-dc3d35214db1365be81906f2eabbaae8a531b3ab984c06eff8fd425f3cb40f2dR37 still works, it was before.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, then leave this for now

@mergify mergify bot merged commit ba06387 into os-autoinst:master Oct 3, 2024
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants