Skip to content

Commit

Permalink
Update Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
SupianIDz committed Aug 3, 2020
1 parent cc4cf04 commit a0b4312
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 40 deletions.
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

# Octopy Sudo
Allow a developer direct login as another user during development inspired by [sudo-su](https://github.com/viacreative/sudo-su).

The reason this library was made is because the [sudo-su](https://github.com/viacreative/sudo-su) package has been inactive for the past few years,
I see someone who has a problem when there are so many users on the database when using the library.

# New Feature
- Limit the number of users displayed
- Search form using tail select.
- Auto discovery, no more setting up your ServiceProvider manually.
- Automatic injection via a middleware, no need to add some code to the blade.

## Installation
To install the package, simply follow the steps below.

Expand All @@ -14,15 +24,16 @@ $ php artisan vendor:publish
```

## Configuration
After running `vendor:publish`, a config file called sudo.php should appear in your project.
After running `vendor:publish`, a config file called `sudo.php` should appear in your project.

## To Do
- [ ] Unit Test
- [ ] UI Improvement
- [ ] Showing user role based on 3rd library like Laratrust, Bouncer and others.

## Disclaimer - DANGER!
This package can pose a serious security issue if used incorrectly, as anybody will be able to take control of any user's account. Please ensure that the service provider is only registered when the app is in a debug/local environment.

By default, the package will disable itself on any domains that don't have a TLD of .dev or .local. This is a security measure to reduce the risk of accidentally enabling the package in production.

By using this package, you agree that Octopy ID and the contributors of this package cannot be held responsible for any damages caused by using this package.

## To Do
- [ ] Unit Test
- [ ] UI Improvement
74 changes: 39 additions & 35 deletions config/sudo.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,52 @@

return [

/*
/*
|--------------------------------------------------------------------------
| Sudo
|--------------------------------------------------------------------------
| Sudo is enabled by default, when debug is set to true in app.php.
| You can override the value by setting enable to true or false instead of null.
|
*/
'enabled' => env('APP_DEBUG', true),
*/
'enabled' => env('APP_DEBUG', true),

/*
|--------------------------------------------------------------------------
| Allowed TLD
|--------------------------------------------------------------------------
|
| This is to prevent mis-usage during production if debug mode is
| unintentionally left active. The package will detect the site
| URL and if the TLD isn't present in this array, it will not
| activate. If your development TLD is different to .dev or
| .local, simply add it to the arrow below.
|
*/
'allowed_tld' => ['dev', 'local'],
/*
|--------------------------------------------------------------------------
| Allowed TLD
|--------------------------------------------------------------------------
|
| This is to prevent mis-usage during production if debug mode is
| unintentionally left active. The package will detect the site
| URL and if the TLD isn't present in this array, it will not
| activate. If your development TLD is different to .dev or
| .local, simply add it to the arrow below.
|
| Fill "*" for wildcard tlds.
|
*/
'allowed_tld' => ['dev', 'local'],

/*
|--------------------------------------------------------------------------
| User Model
|--------------------------------------------------------------------------
|
| Path to the application User model. This will be used to retrieve the users
| displayed in the select dropdown. This must be an Eloquent Model instance.
|
*/
'user_model' => App\User::class,
/*
|--------------------------------------------------------------------------
| User Model
|--------------------------------------------------------------------------
|
| Path to the application User model. This will be used to retrieve the users
| displayed in the select dropdown. This must be an Eloquent Model instance.
|
*/
'user_model' => App\User::class,

/*
|--------------------------------------------------------------------------
| Maximum User Shown
|--------------------------------------------------------------------------
|
| The maximum number of users is displayed
|
*/
'max_shown' => 5,
/*
|--------------------------------------------------------------------------
| Maximum User Shown
|--------------------------------------------------------------------------
|
| The maximum number of users is displayed
|
| Fill in "-1" to display all users
|
*/
'max_shown' => 5,
];

0 comments on commit a0b4312

Please sign in to comment.