
//If you deploy to HANA Cloud
git clone https://github.com/miyasuta/central-launchpad-cap.git
//If you deploy to HANA Service (Trial)
git clone -b hana-service https://github.com/miyasuta/central-launchpad-cap.git
npm install
cds watch
namespace my.bookshop;
entity Books {
key ID : Integer;
title : String;
stock : Integer;
createdBy: String @cds.on.insert : $user; //add
}
ID;title;stock;createdBy
1;Wuthering Heights;100;<your scp userID>
2;Jane Eyre;500;<NOT your scp userID>
using my.bookshop as my from '../db/data-model';
service CatalogService @(requires: 'authenticated-user') {
entity Books as projection on my.Books;
}
annotate CatalogService.Books with @(restrict: [
{ grant: ['READ'], where: 'createdBy = $user'}
]);
npm install passport
{
"welcomeFile": "/index.html",
"authenticationMethod": "route",
"logout": {
"logoutEndpoint": "/do/logout"
},
"routes": [
{
//"authenticationType": "none", Remove this
"csrfProtection": false,
"source": "^/catalog/",
"destination": "cap-launchpad"
},
{
"source": "^(.*)$",
"target": "$1",
"service": "html5-apps-repo-rt",
"authenticationType": "xsuaa"
}
]
}
npm install @sap/xssec @sap/xsenv
"cds": {
"requires": {
"db": {
"kind": "sql"
},
"uaa": {
"kind": "xsuaa"
}
}
}
{
"xsappname": "fiori",
"tenant-mode": "dedicated",
"scopes": [
{
"name": "$XSAPPNAME.admin",
"description": "admin"
},
{
"name": "uaa.user",
"description": "UAA"
}
],
"attributes": [],
"role-templates": [
{
"name": "admin",
"description": "generated",
"scope-references": [
"$XSAPPNAME.admin"
],
"attribute-references": []
},
{
"name": "Token_Exchange",
"description": "UAA",
"scope-references": [
"uaa.user"
]
}
]
}
# --------------------- SERVER MODULE ------------------------
- name: cap-launchpad-srv
# ------------------------------------------------------------
type: nodejs
path: gen/srv
parameters:
memory: 256M
disk-quota: 1024M
requires:
# Resources extracted from CAP configuration
- name: cap-launchpad-db
- name: uaa_fiori //add
provides:
- name: srv-api # required by consumers of CAP services (e.g. approuter)
properties:
srv-url: ${default-url}
# -------------------- SIDECAR MODULE ------------------------
- name: cap-launchpad-db-deployer
# ------------------------------------------------------------
type: hdb
path: gen/db
parameters:
buildpack: nodejs_buildpack
requires:
# 'hana' and 'xsuaa' resources extracted from CAP configuration
- name: cap-launchpad-db
- name: uaa_fiori //add
resources:
...
- name: uaa_fiori
type: org.cloudfoundry.managed-service
parameters:
path: ./xs-security.json
service: xsuaa
service-name: fiori-xsuaa-service
service-plan: application
cd app/fiori
npm install
mbt build
cf deploy mta_archives/cap-launchpad_1.0.0.mtar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
4 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 |