28.01.2013 Views

SAP HANA Developer Guide - Get a Free Blog

SAP HANA Developer Guide - Get a Free Blog

SAP HANA Developer Guide - Get a Free Blog

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

| |---2011...<br />

|---subpackage1<br />

| |---image.jpg<br />

|---subpackage2<br />

| |---subsubpackage<br />

| | |---secret.txt<br />

| |---script.xsjs<br />

|---subpackage3<br />

| |---internal.file<br />

|---users<br />

| |---123...<br />

|---.xsapp<br />

|---.xsaccess<br />

|---index.html<br />

The application-access file for the package apptest (and its subpackages) includes the following rules for<br />

rewriting URLs used in client requests:<br />

{<br />

}<br />

"rewrite_rules": [<br />

{<br />

"source": "/users/(\\d+)/",<br />

"target": "/logic/users.xsjs?id=$1"<br />

},<br />

{<br />

"source": "/posts/(\\d+)/(\\d+)/(\\d+)/",<br />

"target": "/logic/posts.xsjs?year=$1&month=$2&day=$3"<br />

}<br />

]<br />

Assuming we have the package structure and URL rewrite rules illustrated in the previous examples, the following<br />

valid URLs would be exposed; bold URLs require authentication:<br />

/sap/apptest/<br />

/sap/apptest/index.html<br />

/sap/apptest/logic/users.xsjs<br />

/sap/apptest/logic/posts.xsjs<br />

The rewriting of the following URLs would be allowed:<br />

/sap/apptest/users/123/ ==> /sap/appTest/logic/users.xsjs?id=123<br />

/sap/apptest/posts/2011/10/12/ ==> /sap/appTest/logic/posts.xsjs?<br />

year=2011&month=10&day=12<br />

4.4.6 Enabling Access to <strong>SAP</strong> <strong>HANA</strong> XS Application<br />

Packages<br />

The application-access file enables you to specify who or what is authorized to access the content exposed by the<br />

application package and what content they are allowed to see.<br />

You can use a set of keywords in the application-access file .xsaccess to specify if authentication is required to<br />

enable access to package content, which data is exposed, and if rewrite rules are in place to hide target and<br />

source URLs, for example, from users and search engines. You can also specify what, if any, level of authorization<br />

is required for the package and whether SSL is mandatory for client connections.<br />

<strong>SAP</strong> <strong>HANA</strong> <strong>Developer</strong> <strong>Guide</strong><br />

Setting Up Your Application<br />

P U B L I C<br />

© 2012 <strong>SAP</strong> AG. All rights reserved. 57

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!