Skip to content

Commit

Permalink
chore: Cleanup (#7)
Browse files Browse the repository at this point in the history
* Delete asset bundles, we don't need it

* Tidy controller, prep for future actions

* Prep config file

* Cleanup Settings file

* Cleanup services file

* Update PR template

* Changelog
  • Loading branch information
Mike Pierce authored Oct 5, 2019
1 parent 653948f commit 0e56ae0
Show file tree
Hide file tree
Showing 12 changed files with 76 additions and 113 deletions.
13 changes: 3 additions & 10 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,9 @@

Describe what you have changed in this PR and why.

### Tasks

- [ ] Add a list of tasks here that need to done to implement the change
- [ ] All tasks must be checked before a (final) review is requested on the PR

### Definition of Done

- [ ] Ensure feature branch has latest development code integrated
- [ ] Ensure there are no formatting errors

⚠️ PR titles **AND** merge commit messages should adhere to the [Commitzen](https://github.com/commitizen/cz-cli) conventions, please ensure they are correctly formatted.

For example `fields: Added rich text & feature image`
- [ ] Ensure feature branch has latest development code integrated
- [ ] Version number in `composer.json` is updated
- [ ] New entry added in `CHANGELOG.md` documenting changes made
63 changes: 60 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,77 @@
# Craft JWT Auth Changelog
# Changelog

All notable changes to this project will be documented in this file.
All notable changes to this project will be documented in this file, in reverse chronological order by release.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
## 0.1.2 - 2019-10-05

### Added

- Additional instructions to the PR template

### Changed

- Nothing.

### Deprecated

- Nothing.

### Removed

- Deleted some unneeded asset files

- Cleaned up various files of unneeded cruft

### Fixed

- Nothing.

## 0.1.1 - 2019-10-04

### Added

- Nothing.

### Changed

- Changed the name of the package to edenspiekermann/craft-jwt-auth

### Deprecated

- Nothing.

### Removed

- Nothing.

### Fixed

- Nothing.

## 0.1.0 - 2019-10-04

### Added

- Initial release

- Validate incoming requests with a JWT present in the Authentication headers.

- Match a validated JWT to a user account in Craft CMS and login as that user.

- Optionally create a new account if no existing account can be found.

### Changed

- Nothing.

### Deprecated

- Nothing.

### Removed

- Nothing.

### Fixed

- Nothing.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "edenspiekermann/craft-jwt-auth",
"description": "Enable authentication to Craft through the use of JSON Web Tokens (JWT)",
"type": "craft-plugin",
"version": "0.1.1",
"version": "0.1.2",
"keywords": [
"craft",
"cms",
Expand Down
49 changes: 0 additions & 49 deletions src/assetbundles/craftjwtauth/CraftJwtAuthAsset.php

This file was deleted.

11 changes: 0 additions & 11 deletions src/assetbundles/craftjwtauth/dist/css/CraftJwtAuth.css

This file was deleted.

This file was deleted.

11 changes: 0 additions & 11 deletions src/assetbundles/craftjwtauth/dist/js/CraftJwtAuth.js

This file was deleted.

7 changes: 5 additions & 2 deletions src/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@
*/

return [
// TODO: Make these actually do something...

// This controls blah blah blah
"someAttribute" => true,
// Your secrete ket used for signing generated and verifying incoming JWTs
"secretKey" => '',

// Whether to automatically create a user for verified JWTs that don't match an account
"autoCreateUser" => true,
];
26 changes: 7 additions & 19 deletions src/controllers/JWTController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@

namespace edenspiekermann\craftjwtauth\controllers;

use edenspiekermann\craftjwtauth\CraftJwtAuth;

use Craft;
use craft\web\Controller;

/**
Expand All @@ -32,28 +29,19 @@ class JWTController extends Controller
* The actions must be in 'kebab-case'
* @access protected
*/
protected $allowAnonymous = ['index', 'do-something'];
protected $allowAnonymous = [];

// Public Methods
// =========================================================================

/**
* @return mixed
*/
public function actionIndex()
{
$result = 'Welcome to the JWTController actionIndex() method';

return $result;
}

/**
* @return mixed
*/
public function actionDoSomething()
{
$result = 'Welcome to the JWTController actionDoSomething() method';
// TODO: Add an action to generate a JWT for a specific or the logged in user.
// public function actionGenerate()
// {
// $result = 'Welcome to the JWTController actionGenerate() method';

return $result;
}
// return $result;
// }
}
3 changes: 0 additions & 3 deletions src/models/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@

namespace edenspiekermann\craftjwtauth\models;

use edenspiekermann\craftjwtauth\CraftJwtAuth;

use Craft;
use craft\base\Model;

/**
Expand Down
1 change: 0 additions & 1 deletion src/services/JWT.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace edenspiekermann\craftjwtauth\services;

use Craft;
use craft\base\Component;
use craft\helpers\ArrayHelper;

Expand Down
2 changes: 0 additions & 2 deletions src/templates/settings.twig
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@

{% import "_includes/forms" as forms %}

{% do view.registerAssetBundle("edenspiekermann\\craftjwtauth\\assetbundles\\craftjwtauth\\CraftJwtAuthAsset") %}

{{ forms.autosuggestField({
label: 'Secret Key',
instructions: 'Enter your secret key for JWT token signing and verifying',
Expand Down

0 comments on commit 0e56ae0

Please sign in to comment.