Skip to content

Commit da8893e

Browse files
committed
Merge pull request apiman#23 from msavy/fix-cors-blog
Fix cors blog (same issue with echo service as oauth2 blog)
2 parents 3eec221 + 49e44c8 commit da8893e

File tree

3 files changed

+50
-10
lines changed

3 files changed

+50
-10
lines changed

_blog-src/_posts/2015-07-02-cors.adoc

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,15 @@ For the purposes of this blogpost we'll contrive a scenario that allows us to de
4444

4545
=== Preparation
4646

47-
If you have the http://www.apiman.io/latest/download.html[apiman quickstart] running, create an *Organization* called *_Foo_*, then create a *Service* called *_Bar_*. Set your Service's implementation URL to be `http://127.0.0.1:8080/services/echo`, and select *_Rest_* as the type. Move to the *Plans* tab and tick *Make this service public*.
47+
If you have the http://www.apiman.io/latest/download.html[apiman quickstart] running footnote:[For simplicity's sake, I suggest using the instructions in the _'Or simply try this...'_ box], you next need to deploy the *_echo-service_* to act as the backend service for our demo. *Substitute the path below* for the appropriate one corresponding to the version you downloaded.
48+
49+
```ShellSession
50+
cd ~/apiman-1.1.3.Final/wildfly-8.2.0.Final/apiman/quickstarts/echo-service/
51+
mvn clean install
52+
mvn wildfly:deploy
53+
```
54+
55+
Return to the http://127.0.0.1:8080/apimanui[apiman UI] and log in footnote:[If you used the quickstart, the defaults are U: admin P: admin123!]. Create an *Organization* called *_Foo_*, then create a *Service* called *_Bar_*. Set your Service's implementation URL to be `http://127.0.0.1:8080/services/apiman-echo`, and select *_Rest_* as the type. Move to the *Plans* tab and tick *Make this service public*.
4856

4957
Next, move to the *Policies* tab, click *_Add Policy_* and select *CORS Policy* from the dropdown list.
5058

@@ -179,8 +187,8 @@ It works: excellent! Here's our response body:
179187
```json
180188
{
181189
"method" : "GET",
182-
"resource" : "/services/echo",
183-
"uri" : "/services/echo",
190+
"resource" : "/apiman-echo",
191+
"uri" : "/apiman-echo",
184192
"headers" : {
185193
"Host" : "127.0.0.1:8080",
186194
"User-Agent" : "curl/7.37.1",

blog/feed.xml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,17 @@ or <a href="http://www.apiman.io/latest/chat.html">IRC channel&l
386386
<div class="sect2">
387387
<h3 id="preparation">Preparation</h3>
388388
<div class="paragraph">
389-
<p>If you have the <a href="http://www.apiman.io/latest/download.html">apiman quickstart</a> running, create an <strong>Organization</strong> called <strong><em>Foo</em></strong>, then create a <strong>Service</strong> called <strong><em>Bar</em></strong>. Set your Service’s implementation URL to be <code><a href="http://127.0.0.1:8080/services/echo" class="bare">http://127.0.0.1:8080/services/echo</a></code>, and select <strong><em>Rest</em></strong> as the type. Move to the <strong>Plans</strong> tab and tick <strong>Make this service public</strong>.</p>
389+
<p>If you have the <a href="http://www.apiman.io/latest/download.html">apiman quickstart</a> running <span class="footnote">[<a id="_footnoteref_3" class="footnote" href="#_footnote_3" title="View footnote.">3</a>]</span>, you next need to deploy the <strong><em>echo-service</em></strong> to act as the backend service for our demo. <strong>Substitute the path below</strong> for the appropriate one corresponding to the version you downloaded.</p>
390+
</div>
391+
<div class="listingblock">
392+
<div class="content">
393+
<pre class="CodeRay highlight"><code data-lang="ShellSession">cd ~/apiman-1.1.3.Final/wildfly-8.2.0.Final/apiman/quickstarts/echo-service/
394+
mvn clean install
395+
mvn wildfly:deploy</code></pre>
396+
</div>
397+
</div>
398+
<div class="paragraph">
399+
<p>Return to the <a href="http://127.0.0.1:8080/apimanui">apiman UI</a> and log in <span class="footnote">[<a id="_footnoteref_4" class="footnote" href="#_footnote_4" title="View footnote.">4</a>]</span>. Create an <strong>Organization</strong> called <strong><em>Foo</em></strong>, then create a <strong>Service</strong> called <strong><em>Bar</em></strong>. Set your Service’s implementation URL to be <code><a href="http://127.0.0.1:8080/services/apiman-echo" class="bare">http://127.0.0.1:8080/services/apiman-echo</a></code>, and select <strong><em>Rest</em></strong> as the type. Move to the <strong>Plans</strong> tab and tick <strong>Make this service public</strong>.</p>
390400
</div>
391401
<div class="paragraph">
392402
<p>Next, move to the <strong>Policies</strong> tab, click <strong><em>Add Policy</em></strong> and select <strong>CORS Policy</strong> from the dropdown list.</p>
@@ -598,8 +608,8 @@ When <code>Host</code> and <code>Origin</code> are equal
598608
<div class="content">
599609
<pre class="CodeRay highlight"><code data-lang="json">{
600610
<span class="key"><span class="delimiter">"</span><span class="content">method</span><span class="delimiter">"</span></span> : <span class="string"><span class="delimiter">"</span><span class="content">GET</span><span class="delimiter">"</span></span>,
601-
<span class="key"><span class="delimiter">"</span><span class="content">resource</span><span class="delimiter">"</span></span> : <span class="string"><span class="delimiter">"</span><span class="content">/services/echo</span><span class="delimiter">"</span></span>,
602-
<span class="key"><span class="delimiter">"</span><span class="content">uri</span><span class="delimiter">"</span></span> : <span class="string"><span class="delimiter">"</span><span class="content">/services/echo</span><span class="delimiter">"</span></span>,
611+
<span class="key"><span class="delimiter">"</span><span class="content">resource</span><span class="delimiter">"</span></span> : <span class="string"><span class="delimiter">"</span><span class="content">/apiman-echo</span><span class="delimiter">"</span></span>,
612+
<span class="key"><span class="delimiter">"</span><span class="content">uri</span><span class="delimiter">"</span></span> : <span class="string"><span class="delimiter">"</span><span class="content">/apiman-echo</span><span class="delimiter">"</span></span>,
603613
<span class="key"><span class="delimiter">"</span><span class="content">headers</span><span class="delimiter">"</span></span> : {
604614
<span class="key"><span class="delimiter">"</span><span class="content">Host</span><span class="delimiter">"</span></span> : <span class="string"><span class="delimiter">"</span><span class="content">127.0.0.1:8080</span><span class="delimiter">"</span></span>,
605615
<span class="key"><span class="delimiter">"</span><span class="content">User-Agent</span><span class="delimiter">"</span></span> : <span class="string"><span class="delimiter">"</span><span class="content">curl/7.37.1</span><span class="delimiter">"</span></span>,
@@ -673,6 +683,12 @@ When <code>Host</code> and <code>Origin</code> are equal
673683
<div class="footnote" id="_footnote_2">
674684
<a href="#_footnoteref_2">2</a> Use the version corresponding to your selected release of apiman
675685
</div>
686+
<div class="footnote" id="_footnote_3">
687+
<a href="#_footnoteref_3">3</a> For simplicity’s sake, I suggest using the instructions in the <em>'Or simply try this…​'</em> box
688+
</div>
689+
<div class="footnote" id="_footnote_4">
690+
<a href="#_footnoteref_4">4</a> If you used the quickstart, the defaults are U: admin P: admin123!
691+
</div>
676692
&lt;/div&gt;</description>
677693

678694
<category term="security" />
@@ -3154,6 +3170,6 @@ Resolving deltas: 100% (40/40), done.
31543170
<guid isPermaLink="true">http://apiman.io/blog/introduction/overview/2015/01/09/impatient-new-user.html</guid>
31553171
</item>
31563172

3157-
<lastBuildDate>Wed, 08 Jul 2015 12:57:38 -0400</lastBuildDate>
3173+
<lastBuildDate>Thu, 09 Jul 2015 03:22:46 -0400</lastBuildDate>
31583174
</channel>
31593175
</rss>

blog/security/plugin/policy/cors/2015/07/02/cors.html

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,17 @@ <h2 id="let-s-give-it-a-go">Let&#8217;s give it a go</h2>
178178
<div class="sect2">
179179
<h3 id="preparation">Preparation</h3>
180180
<div class="paragraph">
181-
<p>If you have the <a href="http://www.apiman.io/latest/download.html">apiman quickstart</a> running, create an <strong>Organization</strong> called <strong><em>Foo</em></strong>, then create a <strong>Service</strong> called <strong><em>Bar</em></strong>. Set your Service&#8217;s implementation URL to be <code><a href="http://127.0.0.1:8080/services/echo" class="bare">http://127.0.0.1:8080/services/echo</a></code>, and select <strong><em>Rest</em></strong> as the type. Move to the <strong>Plans</strong> tab and tick <strong>Make this service public</strong>.</p>
181+
<p>If you have the <a href="http://www.apiman.io/latest/download.html">apiman quickstart</a> running <span class="footnote">[<a id="_footnoteref_3" class="footnote" href="#_footnote_3" title="View footnote.">3</a>]</span>, you next need to deploy the <strong><em>echo-service</em></strong> to act as the backend service for our demo. <strong>Substitute the path below</strong> for the appropriate one corresponding to the version you downloaded.</p>
182+
</div>
183+
<div class="listingblock">
184+
<div class="content">
185+
<pre class="CodeRay highlight"><code data-lang="ShellSession">cd ~/apiman-1.1.3.Final/wildfly-8.2.0.Final/apiman/quickstarts/echo-service/
186+
mvn clean install
187+
mvn wildfly:deploy</code></pre>
188+
</div>
189+
</div>
190+
<div class="paragraph">
191+
<p>Return to the <a href="http://127.0.0.1:8080/apimanui">apiman UI</a> and log in <span class="footnote">[<a id="_footnoteref_4" class="footnote" href="#_footnote_4" title="View footnote.">4</a>]</span>. Create an <strong>Organization</strong> called <strong><em>Foo</em></strong>, then create a <strong>Service</strong> called <strong><em>Bar</em></strong>. Set your Service&#8217;s implementation URL to be <code><a href="http://127.0.0.1:8080/services/apiman-echo" class="bare">http://127.0.0.1:8080/services/apiman-echo</a></code>, and select <strong><em>Rest</em></strong> as the type. Move to the <strong>Plans</strong> tab and tick <strong>Make this service public</strong>.</p>
182192
</div>
183193
<div class="paragraph">
184194
<p>Next, move to the <strong>Policies</strong> tab, click <strong><em>Add Policy</em></strong> and select <strong>CORS Policy</strong> from the dropdown list.</p>
@@ -390,8 +400,8 @@ <h5 id="keep-it-simple">Keep it simple</h5>
390400
<div class="content">
391401
<pre class="CodeRay highlight"><code data-lang="json">{
392402
<span class="key"><span class="delimiter">&quot;</span><span class="content">method</span><span class="delimiter">&quot;</span></span> : <span class="string"><span class="delimiter">&quot;</span><span class="content">GET</span><span class="delimiter">&quot;</span></span>,
393-
<span class="key"><span class="delimiter">&quot;</span><span class="content">resource</span><span class="delimiter">&quot;</span></span> : <span class="string"><span class="delimiter">&quot;</span><span class="content">/services/echo</span><span class="delimiter">&quot;</span></span>,
394-
<span class="key"><span class="delimiter">&quot;</span><span class="content">uri</span><span class="delimiter">&quot;</span></span> : <span class="string"><span class="delimiter">&quot;</span><span class="content">/services/echo</span><span class="delimiter">&quot;</span></span>,
403+
<span class="key"><span class="delimiter">&quot;</span><span class="content">resource</span><span class="delimiter">&quot;</span></span> : <span class="string"><span class="delimiter">&quot;</span><span class="content">/apiman-echo</span><span class="delimiter">&quot;</span></span>,
404+
<span class="key"><span class="delimiter">&quot;</span><span class="content">uri</span><span class="delimiter">&quot;</span></span> : <span class="string"><span class="delimiter">&quot;</span><span class="content">/apiman-echo</span><span class="delimiter">&quot;</span></span>,
395405
<span class="key"><span class="delimiter">&quot;</span><span class="content">headers</span><span class="delimiter">&quot;</span></span> : {
396406
<span class="key"><span class="delimiter">&quot;</span><span class="content">Host</span><span class="delimiter">&quot;</span></span> : <span class="string"><span class="delimiter">&quot;</span><span class="content">127.0.0.1:8080</span><span class="delimiter">&quot;</span></span>,
397407
<span class="key"><span class="delimiter">&quot;</span><span class="content">User-Agent</span><span class="delimiter">&quot;</span></span> : <span class="string"><span class="delimiter">&quot;</span><span class="content">curl/7.37.1</span><span class="delimiter">&quot;</span></span>,
@@ -465,6 +475,12 @@ <h2 id="in-conclusion">In conclusion&#8230;&#8203;</h2>
465475
<div class="footnote" id="_footnote_2">
466476
<a href="#_footnoteref_2">2</a> Use the version corresponding to your selected release of apiman
467477
</div>
478+
<div class="footnote" id="_footnote_3">
479+
<a href="#_footnoteref_3">3</a> For simplicity&#8217;s sake, I suggest using the instructions in the <em>'Or simply try this&#8230;&#8203;'</em> box
480+
</div>
481+
<div class="footnote" id="_footnote_4">
482+
<a href="#_footnoteref_4">4</a> If you used the quickstart, the defaults are U: admin P: admin123!
483+
</div>
468484
</div>
469485
</article>
470486

0 commit comments

Comments
 (0)