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

feat: store authsources in a database (fix #267) #1817

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

damikael
Copy link
Contributor

If, into config/config.php, are present the parameters:

'authsources.storage' => 'database',
'authsources.database_table' => 'authsources',

then authsources are retrieved from database,
else them are retrieved from file same authsources.php, as before.

If the value of parameter authsources.storage is 'database', then the authsource configuration is retrieved from database.
If the table referred by the parameter authsources.database_table does not exists it will be created.
The table will contain the following fields:

  • id VARCHAR(255) PRIMARY KEY, that is the key of authsource
  • entity_data JSON, that is the configuration of authsource
  • _disabled enum('N','Y') NOT NULL DEFAULT 'N', to enable/disable the authsource

If parameters:

- 'authsources.storage' => 'database',
- 'authsources.database_table' => 'authsources',

are present into config/config.php

authsources are retrieved from database,
else them are retrieved from file
If parameters:

- 'authsources.storage' => 'database',
- 'authsources.database_table' => 'authsources',

are present into config/config.php

authsources are retrieved from database,
else them are retrieved from file
@tvdijen
Copy link
Member

tvdijen commented Jun 22, 2023

I don't think we should put a lot of code in a configuration file...

@damikael
Copy link
Contributor Author

I don't think we should put a lot of code in a configuration file...

Moved code out from authsources config file

@codecov
Copy link

codecov bot commented Jun 23, 2023

Codecov Report

Merging #1817 (2a0f29e) into master (fdbe001) will decrease coverage by 0.05%.
The diff coverage is 43.75%.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1817      +/-   ##
============================================
- Coverage     45.24%   45.20%   -0.05%     
- Complexity     3632     3634       +2     
============================================
  Files           162      162              
  Lines         12303    12323      +20     
============================================
+ Hits           5566     5570       +4     
- Misses         6737     6753      +16     

@damikael damikael requested a review from tvdijen June 23, 2023 09:46
@tvdijen tvdijen force-pushed the master branch 8 times, most recently from 3b5f5ba to 96357ee Compare July 19, 2023 12:37
@tvdijen tvdijen force-pushed the master branch 5 times, most recently from 7587851 to d523b31 Compare August 2, 2023 11:58
@tvdijen tvdijen force-pushed the master branch 2 times, most recently from a7b59f3 to 6f84bae Compare September 2, 2023 10:58
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.

None yet

2 participants