Skip to content

Commit 2a45f08

Browse files
Craig Ballingerxiehan
authored andcommitted
Update to https where possible
1 parent 62d0018 commit 2a45f08

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# http://editorconfig.org
1+
# https://editorconfig.org
22
root = true
33

44
[*]

CODE_OF_CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@
3434
* If violations occur, organizers will take any action they deem appropriate for the infraction, up to and including expulsion.
3535

3636

37-
_Copied from the [Slack Developer Community Code of Conduct](https://api.slack.com/docs/community-code-of-conduct). Portions of the original were derived from the [Django Code of Conduct](https://www.djangoproject.com/conduct/), [The Citizen Code of Conduct](http://citizencodeofconduct.org/), [The Rust Code of Conduct](https://www.rust-lang.org/conduct.html) and [The Ada Initiative](http://adainitiative.org/2014/02/18/howto-design-a-code-of-conduct-for-your-community/) under a Creative Commons [Attribution-ShareAlike](http://creativecommons.org/licenses/by-sa/3.0/) license._
37+
_Copied from the [Slack Developer Community Code of Conduct](https://api.slack.com/docs/community-code-of-conduct). Portions of the original were derived from the [Django Code of Conduct](https://www.djangoproject.com/conduct/), [The Citizen Code of Conduct](http://citizencodeofconduct.org/), [The Rust Code of Conduct](https://www.rust-lang.org/conduct.html) and [The Ada Initiative](https://adainitiative.org/2014/02/18/howto-design-a-code-of-conduct-for-your-community/) under a Creative Commons [Attribution-ShareAlike](https://creativecommons.org/licenses/by-sa/3.0/) license._

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Additionally, we highly recommend doing your development with [Xdebug enabled](h
6161

6262
### Coding Style
6363

64-
We follow the [PSR-1](http://www.php-fig.org/psr/psr-1/) basic coding standards and [PSR-2](http://www.php-fig.org/psr/psr-2/) coding style guide, with the following addenda, exceptions, and clarifications:
64+
We follow the [PSR-1](https://www.php-fig.org/psr/psr-1/) basic coding standards and [PSR-2](https://www.php-fig.org/psr/psr-2/) coding style guide, with the following addenda, exceptions, and clarifications:
6565

6666
* All variables/property names should be in `$camelCase` only.
6767
* We put all opening curly braces on their own separate line, even for control structures.
@@ -82,7 +82,7 @@ XML files are also generated for reporting test results and coverage on a CI ser
8282

8383
### Generating Documentation
8484

85-
We are using [phpDocumentor](http://www.phpdoc.org) paired with the [phpdoc-md](https://github.com/evert/phpdoc-md) plugin to generate documentation in Markdown based on the contents of our PHPDoc blocks. To generate or update the documentation, use:
85+
We are using [phpDocumentor](https://www.phpdoc.org) paired with the [phpdoc-md](https://github.com/evert/phpdoc-md) plugin to generate documentation in Markdown based on the contents of our PHPDoc blocks. To generate or update the documentation, use:
8686

8787
```
8888
./vendor/bin/phpdoc

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ A PHP-based server-side proxy for interacting with the [NPR One API](https://dev
3131

3232
## Background
3333

34-
The [NPR One API](https://dev.npr.org/api/) provides a lightweight [REST](http://www.restapitutorial.com/)/[Hypermedia](https://smartbear.com/learn/api-design/what-is-hypermedia/) interface to power an [NPR One](https://www.npr.org/about/products/npr-one/) experience. To secure our API, we have implemented an authorization server based on the [OAuth 2.0 protocol](https://tools.ietf.org/html/rfc6749), a well-accepted Internet standard.
34+
The [NPR One API](https://dev.npr.org/api/) provides a lightweight [REST](https://www.restapitutorial.com/)/[Hypermedia](https://smartbear.com/learn/api-design/what-is-hypermedia/) interface to power an [NPR One](https://www.npr.org/about/products/npr-one/) experience. To secure our API, we have implemented an authorization server based on the [OAuth 2.0 protocol](https://tools.ietf.org/html/rfc6749), a well-accepted Internet standard.
3535

3636
Third-party developers have two primary methods for obtaining the access tokens required by our API to interact with any of our other micro-services:
3737

@@ -51,9 +51,9 @@ This project is designed to be executed in a server environment with [Apache HTT
5151

5252
### Prerequisites
5353

54-
A recent version of [PHP](http://php.net/), equal to or greater than 5.6.0 is required.
54+
A recent version of [PHP](https://php.net/), equal to or greater than 5.6.0 is required.
5555

56-
The default [EncryptionProvider](/src/Providers/EncryptionProvider.php) class provided in this package relies on the [OpenSSL](http://php.net/manual/en/book.openssl.php) extension. If OpenSSL is unavailable, the consumer has the option to implement a custom EncryptionProvider class that implements our [EncryptionInterface](/src/Interfaces/EncryptionInterface.php). (For more information, see the [EncryptionProvider](#encryptionprovider) section.)
56+
The default [EncryptionProvider](/src/Providers/EncryptionProvider.php) class provided in this package relies on the [OpenSSL](https://php.net/manual/en/book.openssl.php) extension. If OpenSSL is unavailable, the consumer has the option to implement a custom EncryptionProvider class that implements our [EncryptionInterface](/src/Interfaces/EncryptionInterface.php). (For more information, see the [EncryptionProvider](#encryptionprovider) section.)
5757

5858
Usage of NPR's authorization server requires a registered developer account with the [NPR One Developer Center](https://dev.npr.org/). If you do not already have a Dev Center account, you can [register for a personal account](https://dev.npr.org/apply/) and get started immediately.
5959

@@ -100,13 +100,13 @@ There is a sample [ConfigProvider.php](/examples/ConfigProvider.php) in the [exa
100100

101101
If you are using the `authorization_code` grant (and thereby the `AuthCodeController`), create a StorageProvider class which implements our [StorageInterface](/src/Interfaces/StorageInterface.php). The StorageProvider is required to validate the OAuth2 `state` param.
102102

103-
You will find a sample [StorageProvider.php](/examples/StorageProvider.php) file in the [examples](/examples/) folder. The example utilizes [Predis](https://github.com/nrk/predis), a PHP [Redis](http://redis.io/) client, but there are many other options, including [Memcached](http://php.net/manual/en/book.memcached.php) and [PHP sessions](http://php.net/manual/en/book.session.php). MySQL is also an option, but not recommended because it is likely to be much slower. We picked Predis for demonstration purposes because the syntax is very simple and applicable to many other storage layers.
103+
You will find a sample [StorageProvider.php](/examples/StorageProvider.php) file in the [examples](/examples/) folder. The example utilizes [Predis](https://github.com/nrk/predis), a PHP [Redis](https://redis.io/) client, but there are many other options, including [Memcached](https://php.net/manual/en/book.memcached.php) and [PHP sessions](https://php.net/manual/en/book.session.php). MySQL is also an option, but not recommended because it is likely to be much slower. We picked Predis for demonstration purposes because the syntax is very simple and applicable to many other storage layers.
104104

105105
#### Optional
106106

107107
##### EncryptionProvider
108108

109-
The Controller classes will save the refresh token and access token in a cookie by default. In order to keep those refresh tokens secure, we encrypt them before saving and decrypt them when we need to retrieve them. To make this process less cumbersome, a default [EncryptionProvider](/src/Providers/EncryptionProvider.php) has been provided. However, this particular EncryptionProvider relies on the [OpenSSL](http://php.net/manual/en/book.openssl.php) extension being available, which may not be an option for all developers. If OpenSSL is unavailable, or if you want to use a different method of encryption, you can use a custom encryption provider that implements our [EncryptionInterface](/src/Interfaces/EncryptionInterface.php).
109+
The Controller classes will save the refresh token and access token in a cookie by default. In order to keep those refresh tokens secure, we encrypt them before saving and decrypt them when we need to retrieve them. To make this process less cumbersome, a default [EncryptionProvider](/src/Providers/EncryptionProvider.php) has been provided. However, this particular EncryptionProvider relies on the [OpenSSL](https://php.net/manual/en/book.openssl.php) extension being available, which may not be an option for all developers. If OpenSSL is unavailable, or if you want to use a different method of encryption, you can use a custom encryption provider that implements our [EncryptionInterface](/src/Interfaces/EncryptionInterface.php).
110110

111111
If you choose to implement a custom encryption provider, use the [default implementation](/src/Providers/EncryptionProvider.php) as your example. The syntax for including your own custom encryption provider is as follows:
112112

@@ -138,7 +138,7 @@ $controller = (new DeviceCodeController())
138138

139139
##### SecureStorageProvider
140140

141-
As explained above, encrypted cookies are used to store refresh tokens across sessions. However, cookies are not the only possible storage method: [Redis](http://redis.io/) and [Memcached](http://php.net/manual/en/book.memcached.php) are good options (as long as you have a mechanism for identifying the user across sessions, which may still require cookies). If you are considering using PHP's session storage, you may want to take a look at [PHP-Secure-Session](https://github.com/ezimuel/PHP-Secure-Session), which provides an extra layer of security through encryption.
141+
As explained above, encrypted cookies are used to store refresh tokens across sessions. However, cookies are not the only possible storage method: [Redis](https://redis.io/) and [Memcached](https://php.net/manual/en/book.memcached.php) are good options (as long as you have a mechanism for identifying the user across sessions, which may still require cookies). If you are considering using PHP's session storage, you may want to take a look at [PHP-Secure-Session](https://github.com/ezimuel/PHP-Secure-Session), which provides an extra layer of security through encryption.
142142

143143
All of the Controller classes are configured to use the [SecureCookieProvider](/src/Providers/SecureCookieProvider.php) as the default secure storage layer, but you can easily override this using the `setSecureStorageProvider()` function:
144144

examples/ConfigProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ public function getNprAuthorizationServiceHost()
4545
*/
4646
public function getClientUrl()
4747
{
48-
return 'http://nprone.example.com';
48+
return 'https://nprone.example.com';
4949
}
5050

5151
/**
5252
* @inheritdoc
5353
*/
5454
public function getAuthCodeCallbackUrl()
5555
{
56-
return 'http://nprone.example.com/oauth2/callback';
56+
return 'https://nprone.example.com/oauth2/callback';
5757
}
5858

5959
/**

src/Providers/EncryptionProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public function setSalt($salt)
118118
* may not be available on your system. For a complete list of possible inputs, call `openssl_get_cipher_methods()`
119119
* on your server; results will vary by environment.
120120
*
121-
* @see http://php.net/manual/en/function.openssl-get-cipher-methods.php
121+
* @see https://php.net/manual/en/function.openssl-get-cipher-methods.php
122122
*
123123
* @param string $cipherMethod
124124
* @throws \InvalidArgumentException if the passed-in value is not a non-empty string

0 commit comments

Comments
 (0)