Skip to content

MOD-7613: Add search-oss-global-password#5237

Merged
nafraf merged 16 commits intonafraf_config-paramsfrom
nafraf_oss-global-password
Jan 8, 2025
Merged

MOD-7613: Add search-oss-global-password#5237
nafraf merged 16 commits intonafraf_config-paramsfrom
nafraf_oss-global-password

Conversation

@nafraf
Copy link
Collaborator

@nafraf nafraf commented Nov 20, 2024

Describe the changes in the pull request

  1. Configure the module parameter: search-oss-global-password which is equivalent to the previous OSS_GLOBAL_PASSWORD module parameter.
  2. Configure the module parameter: search-oss-acl-username which is equivalent to the previous OSS_ACL_USERNAME

Which issues this PR fixes

  1. MOD-7613

Main objects this PR modified

  1. ...
  2. ...

Mark if applicable

  • This PR introduces API changes
  • This PR introduces serialization changes

@nafraf nafraf changed the base branch from master to nafraf_config-params November 22, 2024 00:55
@nafraf nafraf changed the title Replace OSS_GLOBAL_PASSWORD MOD-7613: Add search-oss-global-password Dec 7, 2024
@nafraf nafraf marked this pull request as ready for review December 9, 2024 12:38
@codecov
Copy link

codecov bot commented Dec 9, 2024

Codecov Report

Attention: Patch coverage is 27.27273% with 16 lines in your changes missing coverage. Please review.

Project coverage is 87.24%. Comparing base (e017288) to head (61512b7).
Report is 2 commits behind head on nafraf_config-params.

Files with missing lines Patch % Lines
src/coord/config.c 5.88% 16 Missing ⚠️
Additional details and impacted files
@@                   Coverage Diff                    @@
##           nafraf_config-params    #5237      +/-   ##
========================================================
- Coverage                 87.28%   87.24%   -0.04%     
========================================================
  Files                       196      196              
  Lines                     34986    34997      +11     
========================================================
- Hits                      30538    30534       -4     
- Misses                     4448     4463      +15     

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

.error().contains('CONFIG SET failed')


@skip(cluster=False, redis_less_than='8.1.0')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should be greater than 8.0.2? (what we have now)

Copy link
Collaborator Author

@nafraf nafraf Dec 13, 2024

Choose a reason for hiding this comment

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

Now it is skipped on less than 8.0, for redis-server 8.0.m02 the version number is v=7.9.225.
Another option is to skip it on less than 7.9.226 to include the test on the 8.0.m03 if it exists.

if (clusterConfig.type == ClusterType_RedisOSS) {
if (RedisModule_RegisterStringConfig (
ctx, "search-oss-global-password", "",
REDISMODULE_CONFIG_IMMUTABLE | REDISMODULE_CONFIG_UNPREFIXED,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we use REDISMODULE_CONFIG_SENSITIVE flag as well to redact it in logging?

Copy link
Collaborator Author

@nafraf nafraf Dec 18, 2024

Choose a reason for hiding this comment

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

Yes, we should. Flag added

// acl-username
RedisModuleString * get_oss_acl_username(const char *name, void *privdata) {
char *str = *(char **)privdata;
if (str) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can null check be dropped? (if initialized properly)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes. Check dropped.

Comment on lines 183 to 185
if (config_oss_acl_username) {
RedisModule_FreeString(NULL, config_oss_acl_username);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not need to free previous value since it is immutable. Consider also denoting the setter is for immutable config params.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changes done and setter function renamed.


CONFIG_SETTER(setGlobalPass) {
RedisModule_Log(RSDummyContext, "warning",
"OSS_GLOBAL_PASSWORD is deprecated. Use `CONFIG SET search-oss-global-password <password>` instead");
Copy link
Collaborator

@kei-nan kei-nan Dec 19, 2024

Choose a reason for hiding this comment

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

Shouldn't the set be in the config file? since it is immutable
Maybe clarify that in the warning.
Also it isn't clear that the operation was able to set the value inf the warning.

@nafraf nafraf merged commit b60a09b into nafraf_config-params Jan 8, 2025
7 checks passed
@nafraf nafraf deleted the nafraf_oss-global-password branch January 8, 2025 18:54
github-merge-queue bot pushed a commit that referenced this pull request Jan 8, 2025
* WIP: Config parameters

* Refactor config register

* MOD-7596: Add mirroring support (#4937)

* * initial commit

* * Use RediSearch branch mirroring fork

* * Code Review - Round #1

* Change maxPending requests when changing the number of connections (#4972)

change the number of maxPending requests when changing the number of connections

* Test boolean parameters

* Fix boolean params default values

* MOD-7695: Decide Ubuntu Runner Using Variable (#4975)

* * initial commit

* * code review

* Enable MT in comunity eddition by default - [MOD-7160] (#4974)

* remove compilation flag (wip)

* finish removing compilation flag

* remove from tests

* MOD-7706 fix ramp-packer version (#4980)

ramp-packer 2.5.10

* HNSW vector index - handle inplace deletion after async [MOD-7643] (#4964)

* Fix inplace deletion in tiered index in vecsim

* remove excessive thread iteration log, finalize test

* update vecsim version

* update vecsim version - fixing bug found in test vecsim with json multi

* remove print from test

* better logging

* test - print warning always

* test2 - print warning DEBUG AND CI ENV VARS

* use force for env vars

* try print instead

* print for GHA annotation

* Add two immutable params

* Fix max-doctablesize name

* MOD-7737: Add relaxation flags to Rocky9 installations (#4989)

Add relaxing installation flags to Rocky platform

* MOD-7646 cmake fetch boost if not exists (#4984)

cmake fetch boost if not exists

* MOD-7465 MOD-7466: Add ACL support for RediSearch, phase 1 (#4957)

* Support ACL for RediSearch commands - wip

* Register RediSearch commands to redis ACL categories

* Add tests

* Small fix

* Add coordinator commands registration

* Register underscored commands to ACL as well

* Remove dangerous from INFO

* Skip test conditioned on redis version

* Fix categories according to new evaluation

* Remove comments

* Fix

* Address review

* Remove TODOs

* Replace macro with function

* Wrap with RM_TRY

* Fix unit-tests

* Touchup

* Address review

* Address review

* Address review

* Bump sanitizer and Valgrind to use 7.4

* Address review

* Touchups

* Remove TODOs

* Fix test

* Address review

* Move hack to src

* WIP: Register numeric params

* WIP: Config numeric params

* WIP: CONFIG value precedence

* Complete boolean parameters

* Test search.partial-indexed-docs

* Fix string configs

* Add index-cursor-limit config

* Fix unit tests

* Create cluster configuration params

* Fix cluster configuration params

* Test MODULE LOADEX numeric config

* WIP: Test MODULE LOADEX bool config

* Fix set_no_gc()

* Fix string config parameters

* Test MODULE LOADEX enum config

* Fix set_workers()

* Fix numeric parameter limit

* Test boolean parameters with config file

* Test with config file: numeric, enum, string

* Add max-aggregate-results and max-search-results

* tidy up

* Add more tests

* Use REDISMODULE_CONFIG_UNPREFIXED flag

* Revert "Use REDISMODULE_CONFIG_UNPREFIXED flag"

This reverts commit b1985fc.

* Use common setfn, getfn for numeric params

* Fix mem leak 1

* Fix mem leak 2 - string config

* Disable immutable limits tests

* Use RLTest >= 0.7.14

* Check version before loading config

* Add testConfigAPILoadTimeNumericParams()

* Fix unit-tests

* Refactor config API function parameters for consistency

* Use privdata in numeric config params

* Refactor boolean config registration and clean up unused macros

* Refactor configuration setter functions to improve consistency

* Refactor coord config functions

* Refactor config functions for improved clarity and consistency

* search-gc-scan-size is Load-Time immutable

* Fixes from code review

* Remove parameter modified validation

* Fix search-ext-load and search-friso-ini tests

* Remove global config vars

* Remove str validation from get_string_config()

* Update default configuration to initialize extLoad and frisoIni as empty strings

* MOD-7613: Add search-oss-global-password (#5237)

1. Configure the module parameter search-oss-global-password which is equivalent to the previous OSS_GLOBAL_PASSWORD module parameter.
2. Configure the module parameter search-oss-acl-username which is equivalent to the previous OSS_ACL_USERNAME

---------

Co-authored-by: kei-nan <[email protected]>
Co-authored-by: GuyAv46 <[email protected]>
Co-authored-by: DvirDukhan <[email protected]>
Co-authored-by: alonre24 <[email protected]>
Co-authored-by: Raz Monsonego <[email protected]>
Co-authored-by: oshadmi <[email protected]>
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.

3 participants