-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from leo108/proxy
Proxy
- Loading branch information
Showing
52 changed files
with
3,266 additions
and
608 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
/vendor/ | ||
composer.lock | ||
|
||
.idea | ||
.idea | ||
.DS_Store | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
database/migrations/2016_10_25_083524_create_proxy_granting_tickets_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Database\Migrations\Migration; | ||
|
||
class CreateProxyGrantingTicketsTable extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::create('cas_proxy_granting_tickets', function (Blueprint $table) { | ||
$table->increments('id'); | ||
$table->string('ticket', 256)->unique(); | ||
$table->string('pgt_url', 1024); | ||
$table->integer('service_id')->unsigned(); | ||
$table->integer('user_id')->unsigned(); | ||
$table->text('proxies')->nullable(); | ||
$table->timestamp('created_at')->nullable(); | ||
$table->timestamp('expire_at')->nullable(); | ||
$table->foreign('service_id')->references('id')->on('cas_services'); | ||
$table->foreign('user_id')->references(config('cas.user_table.id'))->on(config('cas.user_table.name')); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::drop('cas_proxy_granting_tickets'); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
database/migrations/2016_10_25_083620_add_proxies_to_tickets_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Database\Migrations\Migration; | ||
|
||
class AddProxiesToTicketsTable extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::table('cas_tickets', function (Blueprint $table) { | ||
$table->text('proxies')->nullable()->after('user_id'); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::table('cas_tickets', function (Blueprint $table) { | ||
$table->dropColumn('proxies'); | ||
}); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
database/migrations/2016_10_25_092220_add_allow_proxy_to_services_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Database\Migrations\Migration; | ||
|
||
class AddAllowProxyToServicesTable extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::table('cas_services', function (Blueprint $table) { | ||
$table->boolean('allow_proxy')->default(false)->after('name'); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::table('cas_services', function (Blueprint $table) { | ||
$table->dropColumn('allow_proxy'); | ||
}); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
database/migrations/2016_10_29_083634_change_ticket_column_length.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Database\Migrations\Migration; | ||
|
||
class ChangeTicketColumnLength extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::table('cas_tickets', function (Blueprint $table) { | ||
$table->string('ticket', 256)->change(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::table('cas_tickets', function (Blueprint $table) { | ||
$table->string('ticket', 32)->change(); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: leo108 | ||
* Date: 2016/10/23 | ||
* Time: 16:19 | ||
*/ | ||
|
||
namespace Leo108\CAS\Contracts\Responses; | ||
|
||
interface AuthenticationFailureResponse extends BaseResponse | ||
{ | ||
/** | ||
* @param string $code | ||
* @param string $description | ||
* @return $this | ||
*/ | ||
public function setFailure($code, $description); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: leo108 | ||
* Date: 2016/10/23 | ||
* Time: 15:54 | ||
*/ | ||
|
||
namespace Leo108\CAS\Contracts\Responses; | ||
|
||
interface AuthenticationSuccessResponse extends BaseResponse | ||
{ | ||
/** | ||
* @param string $user | ||
* @return $this | ||
*/ | ||
public function setUser($user); | ||
|
||
/** | ||
* @param array $proxies | ||
* @return $this | ||
*/ | ||
public function setProxies($proxies); | ||
|
||
/** | ||
* @param array $attributes | ||
* @return $this | ||
*/ | ||
public function setAttributes($attributes); | ||
|
||
/** | ||
* @param array $ticket | ||
* @return $this | ||
*/ | ||
public function setProxyGrantingTicket($ticket); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: leo108 | ||
* Date: 2016/10/23 | ||
* Time: 16:20 | ||
*/ | ||
|
||
namespace Leo108\CAS\Contracts\Responses; | ||
|
||
use Symfony\Component\HttpFoundation\Response; | ||
|
||
interface BaseResponse | ||
{ | ||
/** | ||
* @return Response | ||
*/ | ||
public function toResponse(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: leo108 | ||
* Date: 2016/10/25 | ||
* Time: 17:48 | ||
*/ | ||
|
||
namespace Leo108\CAS\Contracts\Responses; | ||
|
||
|
||
interface ProxyFailureResponse extends BaseResponse | ||
{ | ||
/** | ||
* @param string $code | ||
* @param string $description | ||
* @return $this | ||
*/ | ||
public function setFailure($code, $description); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: leo108 | ||
* Date: 2016/10/25 | ||
* Time: 18:17 | ||
*/ | ||
|
||
namespace Leo108\CAS\Contracts\Responses; | ||
|
||
interface ProxySuccessResponse extends BaseResponse | ||
{ | ||
/** | ||
* @param string $ticket | ||
* @return $this | ||
*/ | ||
public function setProxyTicket($ticket); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.