Fix SAML without CSP on login + idp pem loading
This commit is contained in:
parent
2eacc46be0
commit
b024dbd007
4 changed files with 125 additions and 127 deletions
|
|
@ -53,6 +53,3 @@ GITLAB_TOKEN=
|
|||
SAML_SP_URL_LIST=""
|
||||
## json sp config
|
||||
SAML_SP_CONFIG=''
|
||||
## IDP CERT
|
||||
SAMLIDP_KEY=
|
||||
SAMLIDP_CERT=
|
||||
|
|
|
|||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -21,3 +21,4 @@ Homestead.json
|
|||
Homestead.yaml
|
||||
npm-debug.log
|
||||
yarn-error.log
|
||||
storage/samlidp/*
|
||||
|
|
|
|||
|
|
@ -25,8 +25,6 @@ data:
|
|||
SENTRY_LARAVEL_DSN: "${APP_SENTRY_LARAVEL_DSN}"
|
||||
GITLAB_URL: "https://${CI_SERVER_HOST}"
|
||||
GITLAB_TOKEN: "${APP_GITLAB_TOKEN}"
|
||||
SAMLIDP_KEY: "${APP_SAMLIDP_KEY}"
|
||||
SAMLIDP_CERT: "${APP_SAMLIDP_CERT}"
|
||||
SAML_SP_URL_LIST: "${APP_SAML_SP_URL_LIST}"
|
||||
SAML_SP_CONFIG: "${APP_SAML_SP_CONFIG}"
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ use App\Http\Controllers\Bo\SiteController;
|
|||
use App\Http\Controllers\Bo\TicketController;
|
||||
use App\Http\Controllers\Bo\TicketTypeController;
|
||||
use App\Http\Controllers\Bo\UserController;
|
||||
use App\Http\Middleware\SecureHeaders;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
|
|
@ -23,141 +24,142 @@ Route::middleware('admin-secure')
|
|||
->group(function () {
|
||||
|
||||
Route::namespace('\App\Http\Controllers\Bo')
|
||||
->withoutMiddleware([SecureHeaders::class])
|
||||
->group(function () {
|
||||
Auth::routes(
|
||||
[
|
||||
'login' => true,
|
||||
'logout' => true,
|
||||
'register' => false,
|
||||
'reset' => true,
|
||||
'confirm' => false,
|
||||
'verify' => false
|
||||
]
|
||||
);
|
||||
Auth::routes(
|
||||
[
|
||||
'login' => true,
|
||||
'logout' => true,
|
||||
'register' => false,
|
||||
'reset' => true,
|
||||
'confirm' => false,
|
||||
'verify' => false
|
||||
]
|
||||
);
|
||||
});
|
||||
|
||||
Route::name('bo.')
|
||||
->group(function () {
|
||||
Route::middleware('auth:backend')
|
||||
->group(function () {
|
||||
// * HOME
|
||||
Route::get('/', [DashboardController::class, 'index'])->name('dashboard');
|
||||
->group(function () {
|
||||
// * HOME
|
||||
Route::get('/', [DashboardController::class, 'index'])->name('dashboard');
|
||||
|
||||
Route::middleware(['can:isAdmin'])
|
||||
->group(function () {
|
||||
// * RESOURCES
|
||||
Route::resource('users', UserController::class)->except('show');
|
||||
Route::resource('informations', InformationController::class)->except('show');
|
||||
Route::resource('ticket_types', TicketTypeController::class)
|
||||
->only(['index', 'edit', 'update'])
|
||||
->withoutMiddleware('htmlsanitize')
|
||||
->middleware('htmlsanitize:template')
|
||||
->parameters(['ticket_types' => 'ticket_type']);
|
||||
Route::resource('packages', PackageController::class)->except('show');
|
||||
Route::resource('dutyhours', DutyhourController::class)->except('show');
|
||||
Route::resource('invoices', InvoiceController::class)
|
||||
->withoutMiddleware('htmlsanitize')
|
||||
->middleware(['htmlsanitize:comment']);
|
||||
Route::resource('companies', CompanyController::class)->except('show');
|
||||
Route::resource('brands', BrandController::class);
|
||||
Route::resource('brands.credit_accounts', AccountController::class)
|
||||
->only(['index', 'create', 'store'])
|
||||
->parameters(['credit_accounts' => 'account']);
|
||||
Route::resource('brands.credit_accounts.credit_logs', CreditLogController::class)
|
||||
->only(['index', 'create', 'store'])
|
||||
->parameters(['credit_accounts' => 'account', 'credit_logs' => 'credit_log']);
|
||||
Route::resource('labels', LabelController::class)->except('show');
|
||||
Route::middleware(['can:isAdmin'])
|
||||
->group(function () {
|
||||
// * RESOURCES
|
||||
Route::resource('users', UserController::class)->except('show');
|
||||
Route::resource('informations', InformationController::class)->except('show');
|
||||
Route::resource('ticket_types', TicketTypeController::class)
|
||||
->only(['index', 'edit', 'update'])
|
||||
->withoutMiddleware('htmlsanitize')
|
||||
->middleware('htmlsanitize:template')
|
||||
->parameters(['ticket_types' => 'ticket_type']);
|
||||
Route::resource('packages', PackageController::class)->except('show');
|
||||
Route::resource('dutyhours', DutyhourController::class)->except('show');
|
||||
Route::resource('invoices', InvoiceController::class)
|
||||
->withoutMiddleware('htmlsanitize')
|
||||
->middleware(['htmlsanitize:comment']);
|
||||
Route::resource('companies', CompanyController::class)->except('show');
|
||||
Route::resource('brands', BrandController::class);
|
||||
Route::resource('brands.credit_accounts', AccountController::class)
|
||||
->only(['index', 'create', 'store'])
|
||||
->parameters(['credit_accounts' => 'account']);
|
||||
Route::resource('brands.credit_accounts.credit_logs', CreditLogController::class)
|
||||
->only(['index', 'create', 'store'])
|
||||
->parameters(['credit_accounts' => 'account', 'credit_logs' => 'credit_log']);
|
||||
Route::resource('labels', LabelController::class)->except('show');
|
||||
|
||||
// * INVOICES
|
||||
Route::get('/invoices/json/paginate', [InvoiceController::class, 'jsonPaginate'])
|
||||
->name('invoices.json-paginate');
|
||||
Route::get('/invoices/{invoice}/download', [InvoiceController::class, 'download'])
|
||||
->name('invoices.download');
|
||||
// * INVOICES
|
||||
Route::get('/invoices/json/paginate', [InvoiceController::class, 'jsonPaginate'])
|
||||
->name('invoices.json-paginate');
|
||||
Route::get('/invoices/{invoice}/download', [InvoiceController::class, 'download'])
|
||||
->name('invoices.download');
|
||||
|
||||
// * PROJECTS
|
||||
Route::resource('projects', ProjectController::class);
|
||||
Route::get('/projects/json/paginate', [ProjectController::class, 'jsonPaginate'])
|
||||
->name('projects.json-paginate');
|
||||
// * PROJECTS
|
||||
Route::resource('projects', ProjectController::class);
|
||||
Route::get('/projects/json/paginate', [ProjectController::class, 'jsonPaginate'])
|
||||
->name('projects.json-paginate');
|
||||
|
||||
// * SITES
|
||||
Route::resource('sites', SiteController::class)->except('index');
|
||||
Route::get('/sites/json/paginate', [SiteController::class, 'jsonPaginate'])
|
||||
->name('sites.json-paginate');
|
||||
// * SITES
|
||||
Route::resource('sites', SiteController::class)->except('index');
|
||||
Route::get('/sites/json/paginate', [SiteController::class, 'jsonPaginate'])
|
||||
->name('sites.json-paginate');
|
||||
|
||||
// * TICKETS
|
||||
Route::get('/tickets/json/paginate', [TicketController::class, 'jsonPaginate'])
|
||||
->name('tickets.json-paginate');
|
||||
Route::post('/ticket/{ticket}/create-issue', [TicketController::class, 'createGitlabIssue'])
|
||||
->middleware('can:createGitlabIssue,ticket')
|
||||
->name('ticket.create-issue');
|
||||
});
|
||||
Route::resource('credit_accounts', AccountController::class)
|
||||
->only(['index'])
|
||||
->parameters(['credit_accounts' => 'account']);
|
||||
Route::resource('credit_accounts.credit_logs', CreditLogController::class)
|
||||
->only(['index'])
|
||||
->parameters(['credit_accounts' => 'account', 'credit_logs' => 'credit_log']);
|
||||
|
||||
// * USERS
|
||||
Route::get('/users/change-password', [UserController::class, 'passwordReset'])
|
||||
->name('users.passwordReset');
|
||||
Route::post('/users/change-password', [UserController::class, 'passwordResetSubmit'])
|
||||
->name('users.passwordResetSubmit');
|
||||
|
||||
// * SITES
|
||||
Route::resource('sites', SiteController::class)->only('index');
|
||||
|
||||
// * TICKETS
|
||||
Route::resource('ticket', TicketController::class)->except(['destroy']);
|
||||
Route::prefix('/ticket')
|
||||
->name('ticket.')
|
||||
->group(function () {
|
||||
// * Estimation
|
||||
Route::name('estimation.')->group(function () {
|
||||
Route::get('/{ticket}/estimate', [EstimationController::class, 'estimate'])
|
||||
->middleware('can:estimate,ticket')
|
||||
->name('estimate');
|
||||
Route::post('/{ticket}/estimate', [EstimationController::class, 'estimateSubmit'])
|
||||
->middleware('can:estimate,ticket')
|
||||
->name('estimateSubmit');
|
||||
Route::post('/{ticket}/estimate/answer', [
|
||||
EstimationController::class, 'estimatePendingSubmit'
|
||||
])
|
||||
->middleware('can:validateEstimate,ticket')
|
||||
->name('estimatePendingSubmit');
|
||||
Route::post('/{ticket}/estimate/cancel', [
|
||||
EstimationController::class,
|
||||
'estimateCancelSubmit'
|
||||
])
|
||||
->middleware('can:cancelEstimate,ticket')
|
||||
->name('estimateCancelSubmit');
|
||||
// * TICKETS
|
||||
Route::get('/tickets/json/paginate', [TicketController::class, 'jsonPaginate'])
|
||||
->name('tickets.json-paginate');
|
||||
Route::post('/ticket/{ticket}/create-issue', [TicketController::class, 'createGitlabIssue'])
|
||||
->middleware('can:createGitlabIssue,ticket')
|
||||
->name('ticket.create-issue');
|
||||
});
|
||||
Route::resource('credit_accounts', AccountController::class)
|
||||
->only(['index'])
|
||||
->parameters(['credit_accounts' => 'account']);
|
||||
Route::resource('credit_accounts.credit_logs', CreditLogController::class)
|
||||
->only(['index'])
|
||||
->parameters(['credit_accounts' => 'account', 'credit_logs' => 'credit_log']);
|
||||
|
||||
Route::post('/{ticket}/assignTo', [TicketController::class, 'assignTo'])
|
||||
->middleware('can:assignTo,ticket')
|
||||
->name('assignTo');
|
||||
Route::post('/{ticket}/reopen', [TicketController::class, 'reopen'])
|
||||
->middleware('can:reopen,ticket')
|
||||
->name('reopen');
|
||||
Route::post('/{ticket}/status', [TicketController::class, 'changeStatus'])
|
||||
->middleware('can:changeStatus,ticket')
|
||||
->name('changeStatus');
|
||||
Route::post('/{ticket}/subscribe', [TicketController::class, 'subscribe'])
|
||||
->middleware('can:suscribeToTicket,ticket')
|
||||
->name('subscribe');
|
||||
Route::put('/{ticket}/archive', [TicketController::class, 'setToArchive'])
|
||||
->middleware('can:changeStatus,ticket')
|
||||
->name('archive');
|
||||
Route::put('/{ticket}/message/create', [TicketController::class, 'createMessage'])
|
||||
->middleware('can:createMessage,ticket')
|
||||
->name('message.create');
|
||||
Route::put('/{ticket}/message/{message}/update', [
|
||||
TicketController::class,
|
||||
'updateMessage'
|
||||
])->middleware('can:updateMessage,ticket,message')
|
||||
->name('message.update');
|
||||
});
|
||||
});
|
||||
// * USERS
|
||||
Route::get('/users/change-password', [UserController::class, 'passwordReset'])
|
||||
->name('users.passwordReset');
|
||||
Route::post('/users/change-password', [UserController::class, 'passwordResetSubmit'])
|
||||
->name('users.passwordResetSubmit');
|
||||
|
||||
// * SITES
|
||||
Route::resource('sites', SiteController::class)->only('index');
|
||||
|
||||
// * TICKETS
|
||||
Route::resource('ticket', TicketController::class)->except(['destroy']);
|
||||
Route::prefix('/ticket')
|
||||
->name('ticket.')
|
||||
->group(function () {
|
||||
// * Estimation
|
||||
Route::name('estimation.')->group(function () {
|
||||
Route::get('/{ticket}/estimate', [EstimationController::class, 'estimate'])
|
||||
->middleware('can:estimate,ticket')
|
||||
->name('estimate');
|
||||
Route::post('/{ticket}/estimate', [EstimationController::class, 'estimateSubmit'])
|
||||
->middleware('can:estimate,ticket')
|
||||
->name('estimateSubmit');
|
||||
Route::post('/{ticket}/estimate/answer', [
|
||||
EstimationController::class, 'estimatePendingSubmit'
|
||||
])
|
||||
->middleware('can:validateEstimate,ticket')
|
||||
->name('estimatePendingSubmit');
|
||||
Route::post('/{ticket}/estimate/cancel', [
|
||||
EstimationController::class,
|
||||
'estimateCancelSubmit'
|
||||
])
|
||||
->middleware('can:cancelEstimate,ticket')
|
||||
->name('estimateCancelSubmit');
|
||||
});
|
||||
|
||||
Route::post('/{ticket}/assignTo', [TicketController::class, 'assignTo'])
|
||||
->middleware('can:assignTo,ticket')
|
||||
->name('assignTo');
|
||||
Route::post('/{ticket}/reopen', [TicketController::class, 'reopen'])
|
||||
->middleware('can:reopen,ticket')
|
||||
->name('reopen');
|
||||
Route::post('/{ticket}/status', [TicketController::class, 'changeStatus'])
|
||||
->middleware('can:changeStatus,ticket')
|
||||
->name('changeStatus');
|
||||
Route::post('/{ticket}/subscribe', [TicketController::class, 'subscribe'])
|
||||
->middleware('can:suscribeToTicket,ticket')
|
||||
->name('subscribe');
|
||||
Route::put('/{ticket}/archive', [TicketController::class, 'setToArchive'])
|
||||
->middleware('can:changeStatus,ticket')
|
||||
->name('archive');
|
||||
Route::put('/{ticket}/message/create', [TicketController::class, 'createMessage'])
|
||||
->middleware('can:createMessage,ticket')
|
||||
->name('message.create');
|
||||
Route::put('/{ticket}/message/{message}/update', [
|
||||
TicketController::class,
|
||||
'updateMessage'
|
||||
])->middleware('can:updateMessage,ticket,message')
|
||||
->name('message.update');
|
||||
});
|
||||
});
|
||||
|
||||
// * Session Ping
|
||||
Route::get('/ping', function () {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue