Skip to content

Commit 47e1d05

Browse files
committed
Remove meaningless option 'none'
1 parent e57c741 commit 47e1d05

File tree

6 files changed

+12
-10
lines changed

6 files changed

+12
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ Configure authentication in `config/mcp-server.php`:
312312

313313
**Available Drivers:**
314314

315-
- **`none`** (Development): No authentication required - useful for development and testing
315+
- **`null`** (Development): No authentication required - useful for development and testing
316316
- **`sanctum`** (Recommended): Laravel Sanctum token authentication
317317
- **`passport`** (Enterprise): Laravel Passport OAuth2 authentication
318318
- **`custom`** (Advanced): Custom authentication provider implementation

config/mcp-server.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@
232232
| AUTHENTICATION METHODS:
233233
| ======================
234234
|
235-
| 'none': No authentication (development only)
235+
| null: No authentication (development only)
236236
| 'sanctum': Laravel Sanctum token authentication
237237
| 'passport': Laravel Passport OAuth2 authentication
238238
| 'jwt': JWT token authentication (requires tymon/jwt-auth)
@@ -246,18 +246,18 @@
246246
|----------------------------------------------------------------------
247247
|
248248
| The authentication method to use. Available drivers:
249-
| - 'none': No authentication (development only)
249+
| - null: No authentication (development only)
250250
| - 'sanctum': Laravel Sanctum token authentication (recommended)
251251
| - 'passport': Laravel Passport OAuth2 authentication (enterprise)
252252
| - 'custom': Custom authentication provider
253253
|
254254
| Environment examples:
255-
| - Development: 'none'
255+
| - Development: null
256256
| - Production API: 'sanctum'
257257
| - Enterprise SSO: 'passport'
258258
|
259259
*/
260-
'driver' => 'none',
260+
'driver' => null,
261261

262262
/*
263263
|----------------------------------------------------------------------

src/Auth/AuthManager.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ class AuthManager extends Manager
1212
{
1313
public function getDefaultDriver(): string
1414
{
15-
return $this->config->get('mcp-server.auth.driver', 'none');
15+
$driver = $this->config->get('mcp-server.auth.driver');
16+
return $driver ?: 'none';
1617
}
1718

1819
public function createNoneDriver(): AuthProvider

src/Auth/Traits/AuthConfigHelper.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ trait AuthConfigHelper
1414
*/
1515
protected function isAuthEnabled(): bool
1616
{
17-
return config('mcp-server.auth.driver', 'none') !== 'none';
17+
$driver = config('mcp-server.auth.driver');
18+
return !empty($driver);
1819
}
1920

2021
/**

tests/Auth/Middleware/McpAuthenticateTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
$this->middleware = new McpAuthenticate($this->authManager);
1212
});
1313

14-
it('skips authentication when driver is none', function () {
15-
config(['mcp-server.auth.driver' => 'none']);
14+
it('skips authentication when driver is null', function () {
15+
config(['mcp-server.auth.driver' => null]);
1616

1717
$request = Request::create('/test', 'POST', ['id' => 123]);
1818
$next = fn ($req) => response()->json(['success' => true]);

tests/Auth/Middleware/McpRateLimitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
});
1717

1818
it('skips rate limiting when auth is disabled', function () {
19-
config(['mcp-server.auth.driver' => 'none']);
19+
config(['mcp-server.auth.driver' => null]);
2020

2121
$request = Request::create('/test', 'POST', ['id' => 123]);
2222
$next = fn ($req) => response()->json(['success' => true]);

0 commit comments

Comments
 (0)