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

Add ability to store SAML Service Providers in database #153

Conversation

JamesMowatt
Copy link
Contributor

@JamesMowatt JamesMowatt commented Jan 29, 2025

This PR adds the functionality allowing you to declare service providers within the database rather than a fixed config file.

To use the database instead, set the samlidp.sp to be \CodeGreenCreative\SamlIdp\Models\SamlServiceProvider::class instead of the config array.

@JamesMowatt
Copy link
Contributor Author

@upwebdesign do you feel this is inline with the package? It's not ready to merge, but want to check you would be happy with this continuing?

@upwebdesign
Copy link
Contributor

@JamesMowatt, I love this idea. I have never liked defining the service providers in the .env file. It's messy and error-prone. Please continue if you have the time. I am currently pressed for time, so I appreciate your contribution.

@JamesMowatt
Copy link
Contributor Author

@upwebdesign I will continue down this route, will test and tag you when it's ready. Thanks

@JamesMowatt JamesMowatt marked this pull request as ready for review January 31, 2025 13:32
@JamesMowatt
Copy link
Contributor Author

@upwebdesign this is ready for review, I have tested it on my local SAML workbench.

@JamesMowatt JamesMowatt changed the title [DRAFT] Add ability to store SAML Service Providers in database Add ability to store SAML Service Providers in database Jan 31, 2025
Copy link

@NeilInnes NeilInnes left a comment

Choose a reason for hiding this comment

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

Looks great! 😄

Copy link
Contributor

@upwebdesign upwebdesign left a comment

Choose a reason for hiding this comment

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

Other than the table name, I think this looks good! Let me know your thoughts on renaming the table in the database.

*/
public function up(): void
{
Schema::create('saml_service_providers', function (Blueprint $table) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should prefix the package name with the table name.

laravel_samlidp_service_providers

This naming convention will clarify what the table is for and reduce the likelihood of a collision.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Absolutely happy with that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@upwebdesign that is ready to look at again.

@JamesMowatt
Copy link
Contributor Author

@upwebdesign this is ready for review, hope everything is sorted.

@upwebdesign upwebdesign merged commit 4c40a77 into codegreencreative:master Feb 19, 2025
@upwebdesign
Copy link
Contributor

@JamesMowatt, it appears there is a compatibility issue with a method in the migration. publishesMigrations is a Laravel 11 function, but the package supports version 7+. Can you look into this?

@upwebdesign
Copy link
Contributor

It appears this code is the fix. The path may need to be updated.

$this->publishes([
    __DIR__ . '/../database/migrations' => database_path('migrations'),
], 'migrations');

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