Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
Doorcode
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Guardians of the Kretschmar Elock System
Doorcode
Commits
0a14641e
Commit
0a14641e
authored
Dec 17, 2020
by
Jacob Priddy
👌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
api doc updates
parent
d4e24e69
Pipeline
#13230
passed with stages
in 9 minutes and 21 seconds
Changes
6
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
469 additions
and
91 deletions
+469
-91
.gitlab-ci.yml
.gitlab-ci.yml
+1
-7
src/backend/app/Documentation/Strategies/BodyAuthenticationStrategy.php
...p/Documentation/Strategies/BodyAuthenticationStrategy.php
+3
-0
src/backend/app/Documentation/Strategies/UnauthenticatedResponseStrategy.php
...umentation/Strategies/UnauthenticatedResponseStrategy.php
+9
-3
src/backend/composer.json
src/backend/composer.json
+5
-8
src/backend/composer.lock
src/backend/composer.lock
+446
-68
src/backend/config/scribe.php
src/backend/config/scribe.php
+5
-5
No files found.
.gitlab-ci.yml
View file @
0a14641e
...
@@ -69,12 +69,6 @@ generate_api_docs:
...
@@ -69,12 +69,6 @@ generate_api_docs:
-
cd src/backend
-
cd src/backend
-
sed -i 's/\(^APP_ENV=\).*/\1memory/' .env
-
sed -i 's/\(^APP_ENV=\).*/\1memory/' .env
-
sed -i "s/\(^APP_URL=\).*/\1https:\/\/${DEPLOY_ADDRESS}/" .env
-
sed -i "s/\(^APP_URL=\).*/\1https:\/\/${DEPLOY_ADDRESS}/" .env
# TEMPORARY UNTIL THIS BRANCH GETS MERGED INTO THE SCRIBE PROJECT
# PHP 8 came out less than a month ago and not everything supports it yet T_T
-
cd vendor/knuckleswtf
-
rm -rf scribe
-
git clone --branch php8 https://github.com/knuckleswtf/scribe.git
-
cd ../..
-
"
if
(php
artisan
scribe:generate
|
grep
\"
Exception
\"
)
then
echo
\"
Failed
to
generate
API
docs.
\"
&&
false;
else
true;
fi"
-
"
if
(php
artisan
scribe:generate
|
grep
\"
Exception
\"
)
then
echo
\"
Failed
to
generate
API
docs.
\"
&&
false;
else
true;
fi"
artifacts
:
artifacts
:
paths
:
paths
:
...
@@ -113,7 +107,7 @@ deploy application:
...
@@ -113,7 +107,7 @@ deploy application:
-
docker build --build-arg APP_IMAGE=$DOORCODE_IMAGE_NAME -t $NGINX_IMAGE_NAME -f nginx.Dockerfile .
-
docker build --build-arg APP_IMAGE=$DOORCODE_IMAGE_NAME -t $NGINX_IMAGE_NAME -f nginx.Dockerfile .
-
docker stack deploy -c docker-compose.prod.yml doorcode --prune
-
docker stack deploy -c docker-compose.prod.yml doorcode --prune
# Give it some time to spin up...
# Give it some time to spin up...
-
sleep
6
0
-
sleep
12
0
# Make sure app is running
# Make sure app is running
-
"
curl
--fail
--insecure
--silent
--location
https://${DEPLOY_ADDRESS}/api
>
/dev/null"
-
"
curl
--fail
--insecure
--silent
--location
https://${DEPLOY_ADDRESS}/api
>
/dev/null"
-
"
curl
--fail
--insecure
--silent
--location
https://${DEPLOY_ADDRESS}/api/docs
>
/dev/null"
-
"
curl
--fail
--insecure
--silent
--location
https://${DEPLOY_ADDRESS}/api/docs
>
/dev/null"
...
...
src/backend/app/Documentation/Strategies/BodyAuthenticationStrategy.php
View file @
0a14641e
...
@@ -29,6 +29,9 @@ class BodyAuthenticationStrategy extends Strategy
...
@@ -29,6 +29,9 @@ class BodyAuthenticationStrategy extends Strategy
if
(
$controller
->
getShortName
()
===
'MeController'
)
{
if
(
$controller
->
getShortName
()
===
'MeController'
)
{
$token
=
'token_string_engr'
;
$token
=
'token_string_engr'
;
}
}
if
(
$controller
->
getShortName
()
===
'DoorController'
)
{
$token
=
'door_1_api_token'
;
}
return
[
return
[
'api_token'
=>
[
'api_token'
=>
[
...
...
src/backend/app/Documentation/Strategies/UnauthenticatedResponseStrategy.php
View file @
0a14641e
...
@@ -21,13 +21,19 @@ class UnauthenticatedResponseStrategy extends Strategy
...
@@ -21,13 +21,19 @@ class UnauthenticatedResponseStrategy extends Strategy
return
null
;
return
null
;
}
}
return
[
$unauthenticated
=
[
[
'content'
=>
[
'content'
=>
[
'message'
=>
'Unauthenticated'
,
'message'
=>
'Unauthenticated'
,
],
],
'status'
=>
401
,
'status'
=>
401
,
],
];
if
(
$controller
->
getShortName
()
===
'DoorController'
)
{
return
[
$unauthenticated
];
}
return
[
$unauthenticated
,
[
[
'content'
=>
[
'content'
=>
[
'message'
=>
'Unauthorized'
,
'message'
=>
'Unauthorized'
,
...
...
src/backend/composer.json
View file @
0a14641e
{
{
"name"
:
"
laravel/laravel
"
,
"name"
:
"
wwu/elock
"
,
"type"
:
"project"
,
"type"
:
"project"
,
"description"
:
"The Laravel Framework."
,
"description"
:
"Elock doorcode protection system."
,
"keywords"
:
[
"framework"
,
"laravel"
],
"license"
:
"MIT"
,
"license"
:
"MIT"
,
"require"
:
{
"require"
:
{
"php"
:
"^8.0"
,
"php"
:
"^8.0"
,
...
@@ -14,6 +10,7 @@
...
@@ -14,6 +10,7 @@
"fruitcake/laravel-cors"
:
"^1.0"
,
"fruitcake/laravel-cors"
:
"^1.0"
,
"laravel/framework"
:
"^8.0"
,
"laravel/framework"
:
"^8.0"
,
"laravel/tinker"
:
"^2.0"
,
"laravel/tinker"
:
"^2.0"
,
"guzzlehttp/guzzle"
:
"^7.0.1"
,
"laravel/ui"
:
"^3.0"
,
"laravel/ui"
:
"^3.0"
,
"rlanvin/php-rrule"
:
"^2.2"
,
"rlanvin/php-rrule"
:
"^2.2"
,
"ext-json"
:
"*"
"ext-json"
:
"*"
...
@@ -22,8 +19,8 @@
...
@@ -22,8 +19,8 @@
"bamarni/composer-bin-plugin"
:
"^1.4"
,
"bamarni/composer-bin-plugin"
:
"^1.4"
,
"facade/ignition"
:
"^2.3.6"
,
"facade/ignition"
:
"^2.3.6"
,
"friendsofphp/php-cs-fixer"
:
"^2.16"
,
"friendsofphp/php-cs-fixer"
:
"^2.16"
,
"f
zaninotto
/faker"
:
"^1.9.1"
,
"f
akerphp
/faker"
:
"^1.9.1"
,
"knuckleswtf/scribe"
:
"^2.
0
.0"
,
"knuckleswtf/scribe"
:
"^2.
5
.0"
,
"mockery/mockery"
:
"^1.0"
,
"mockery/mockery"
:
"^1.0"
,
"nunomaduro/collision"
:
"^5.0"
,
"nunomaduro/collision"
:
"^5.0"
,
"phpunit/phpunit"
:
"^9.5"
,
"phpunit/phpunit"
:
"^9.5"
,
...
...
src/backend/composer.lock
View file @
0a14641e
This diff is collapsed.
Click to expand it.
src/backend/config/scribe.php
View file @
0a14641e
...
@@ -98,7 +98,8 @@ return [
...
@@ -98,7 +98,8 @@ return [
* Any extra authentication-related info for your users. For instance, you can describe how to find or generate their auth credentials.
* Any extra authentication-related info for your users. For instance, you can describe how to find or generate their auth credentials.
* Markdown and HTML are supported.
* Markdown and HTML are supported.
*/
*/
'extra_info'
=>
'You can retrieve receive a temporary token by using the login api, or by requesting a permanent API token from an ELock Admin.'
,
'extra_info'
=>
'This API can also be authenticated using a Bearer token (required in the case of doors), or using a session cookie.'
.
'You can retrieve receive a temporary token by using the login api, or by requesting a permanent API token from an Elock Admin.'
,
],
],
/*
/*
...
@@ -131,7 +132,7 @@ INTRO
...
@@ -131,7 +132,7 @@ INTRO
* The base URL to be used in examples.
* The base URL to be used in examples.
* If this is null, Scribe will use the value of config('app.url').
* If this is null, Scribe will use the value of config('app.url').
*/
*/
'base_url'
=>
'https://elock.cs.wallawalla.edu'
,
'base_url'
=>
null
,
/*
/*
* Generate a Postman collection in addition to HTML docs.
* Generate a Postman collection in addition to HTML docs.
...
@@ -266,8 +267,7 @@ INTRO
...
@@ -266,8 +267,7 @@ INTRO
'headers'
=>
[
'headers'
=>
[
'Content-Type'
=>
'application/json'
,
'Content-Type'
=>
'application/json'
,
'Accept'
=>
'application/json'
,
'Accept'
=>
'application/json'
,
'Authorization'
=>
'Bearer token_string_engr'
,
// 'Authorization' => 'Bearer token_string_engr',
// 'Api-Version' => 'v2',
],
],
/*
/*
...
@@ -454,7 +454,7 @@ INTRO
...
@@ -454,7 +454,7 @@ INTRO
'headers'
=>
[
'headers'
=>
[
'Content-Type'
=>
'application/json'
,
'Content-Type'
=>
'application/json'
,
'Accept'
=>
'application/json'
,
'Accept'
=>
'application/json'
,
'Authorization'
=>
'Bearer token_string_admin'
,
//
'Authorization' => 'Bearer token_string_admin',
],
],
/*
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment