Skip to content
This repository has been archived by the owner on Nov 26, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/1.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
breart committed Sep 24, 2017
2 parents c05c603 + edd9c6f commit 8146eb9
Show file tree
Hide file tree
Showing 12 changed files with 1,671 additions and 11 deletions.
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.2.0] - 2017-09-24

### Added
- `JWTClient` to create requests to the JIRA/Confluence (closes #3)
- Pagination (used by `JWTClient`)
- Note about using route helper in the `AppServiceProvider` to the README

### Fixed
- Typos and code style issues
- TODO section in the README

## [1.1.0] - 2017-09-08

### Added
Expand All @@ -28,7 +39,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Fixed
- Package keywords at composer.json

[Unreleased]: https://github.com/brezzhnev/atlassian-connect-core/compare/v1.0.0...HEAD
[Unreleased]: https://github.com/brezzhnev/atlassian-connect-core/compare/v1.2.0...HEAD
[1.2.0]: https://github.com/brezzhnev/atlassian-connect-core/compare/v1.1.0...v1.2.0
[1.1.0]: https://github.com/brezzhnev/atlassian-connect-core/compare/v1.0.2...v1.1.0
[1.0.2]: https://github.com/brezzhnev/atlassian-connect-core/compare/v1.0.1...v1.0.2
[1.0.1]: https://github.com/brezzhnev/atlassian-connect-core/compare/v1.0.0...v1.0.1
29 changes: 25 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ You can use `Descriptor` facade to customize or create from scratch your own des

For example, you can customize it by adding to the `app\Providers\AppServiceProvider` in `boot` section the following:

```
``` php
Descriptor::base() // base descriptor contents
->setScopes(['admin' , 'act_as_user'])
->withModules([
Expand All @@ -166,6 +166,27 @@ Descriptor::base() // base descriptor contents
->set('version', $this->getLatestPluginVersion());
```

> Warning: if you are using `route` helper in the `AppServiceProvider` you should have `RouteServiceProvider` defined above `AppServiceProvider` in your `app.php` config.
### Performing requests

In most of cases in development add-on for Atlassian Product you need to perform requests to the instance.

For this case you should use `JWTClient`. It uses [GuzzleHttp](https://github.com/guzzle/guzzle) as HTTP client and
if you want to have custom handling (middlewares etc.) you can pass client instance to the constructor.

#### Pagination

If you want to send a request to an endpoint with pagination you should use `JWTClient::paginate` method. In most cases
you don't need to pass paginator instance to the `JWTClient` constructor because it will instantiate automatically by resolving
your Tenant product type (JIRA or Confluence), but you always can use specific paginator.

There are two paginators:
* `JiraPaginator`
* `ConfluencePaginator`

Of course you can extend `Paginator` class and create your own.

### Console commands

* `plugin:install` is a helper command that creates "dummy" tenant with fake data and publishes package resources (config, views, assets)
Expand All @@ -179,11 +200,11 @@ Run the following in the package folder:
vendor/bin/phpunit
```

## TODOs
## TODO

* Add OAuth authentication method
* Implement descriptor builder and validator
* Implement webhooks gateway
* Implement webhooks manager
* Take out pagination and make more abstract

## Security

Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"require": {
"php": ">=7.0",
"firebase/php-jwt": "^5.0",
"guzzlehttp/guzzle": "^6.3",
"illuminate/support": "~5.5"
},
"require-dev": {
Expand Down
235 changes: 233 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions src/Exceptions/PaginationException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace AtlassianConnectCore\Exceptions;

/**
* Class PaginationException
*
* @package AtlassianConnectCore\Exceptions
*/
class PaginationException extends \RuntimeException
{
}
Loading

0 comments on commit 8146eb9

Please sign in to comment.