gluu
公開メンバ関数 | 静的公開メンバ関数 | 全メンバ一覧
org.xdi.oxd.server.RsProtectTest クラス
org.xdi.oxd.server.RsProtectTest 連携図
Collaboration graph

公開メンバ関数

void protect (String host, String redirectUrl, String opHost, String rsProtect) throws IOException
 
void overwriteFalse (String host, String redirectUrl, String opHost, String rsProtect) throws IOException
 
void overwriteTrue (String host, String redirectUrl, String opHost, String rsProtect) throws IOException
 
void protectWithScopeExpression (String host, String redirectUrl, String opHost, String rsProtectScopeExpression) throws IOException
 
void protectWithScopeExpressionSeconds (String host, String redirectUrl, String opHost, String rsProtectScopeExpressionSecond) throws IOException
 

静的公開メンバ関数

static RsProtectResponse protectResources (ClientInterface client, RegisterSiteResponse site, List< RsResource > resources)
 

詳解

著者
Yuriy Zabrovarnyy
バージョン
0.9, 10/06/2016

関数詳解

◆ overwriteFalse()

void org.xdi.oxd.server.RsProtectTest.overwriteFalse ( String  host,
String  redirectUrl,
String  opHost,
String  rsProtect 
) throws IOException
inline
44  {
45  ClientInterface client = Tester.newClient(host);
46 
47  final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrl);
48 
49  List<RsResource> resources = UmaFullTest.resourceList(rsProtect).getResources();
50  protectResources(client, site, resources);
51 
52  final RsProtectParams2 params = new RsProtectParams2();
53  params.setOxdId(site.getOxdId());
54  params.setResources(Jackson2.createJsonMapper().readTree(CoreUtils.asJsonSilently(resources)));
55 
56  ErrorResponse errorResponse = client.umaRsProtect(Tester.getAuthorization(), params).dataAsResponse(ErrorResponse.class);
57  assertNotNull(errorResponse);
58  assertEquals(errorResponse.getError(), "uma_protection_exists");
59  }
static RsProtectResponse protectResources(ClientInterface client, RegisterSiteResponse site, List< RsResource > resources)
Definition: RsProtectTest.java:112

◆ overwriteTrue()

void org.xdi.oxd.server.RsProtectTest.overwriteTrue ( String  host,
String  redirectUrl,
String  opHost,
String  rsProtect 
) throws IOException
inline
63  {
64  ClientInterface client = Tester.newClient(host);
65 
66  final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrl);
67 
68  List<RsResource> resources = UmaFullTest.resourceList(rsProtect).getResources();
69  protectResources(client, site, resources);
70 
71  final RsProtectParams2 params = new RsProtectParams2();
72  params.setOxdId(site.getOxdId());
73  params.setResources(Jackson2.createJsonMapper().readTree(CoreUtils.asJsonSilently(resources)));
74  params.setOverwrite(true); // force overwrite
75 
76  RsProtectResponse response = client.umaRsProtect(Tester.getAuthorization(), params).dataAsResponse(RsProtectResponse.class);
77  assertNotNull(response);
78  }
static RsProtectResponse protectResources(ClientInterface client, RegisterSiteResponse site, List< RsResource > resources)
Definition: RsProtectTest.java:112

◆ protect()

void org.xdi.oxd.server.RsProtectTest.protect ( String  host,
String  redirectUrl,
String  opHost,
String  rsProtect 
) throws IOException
inline
32  {
33 
34  ClientInterface client = Tester.newClient(host);
35 
36  final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrl);
37 
38  protectResources(client, site, UmaFullTest.resourceList(rsProtect).getResources());
39  RsCheckAccessTest.checkAccess(client, site);
40  }
static RsProtectResponse protectResources(ClientInterface client, RegisterSiteResponse site, List< RsResource > resources)
Definition: RsProtectTest.java:112

◆ protectResources()

static RsProtectResponse org.xdi.oxd.server.RsProtectTest.protectResources ( ClientInterface  client,
RegisterSiteResponse  site,
List< RsResource >  resources 
)
inlinestatic
112  {
113  final RsProtectParams2 params = new RsProtectParams2();
114  params.setOxdId(site.getOxdId());
115  try {
116  params.setResources(Jackson2.createJsonMapper().readTree(CoreUtils.asJsonSilently(resources)));
117  } catch (IOException e) {
118  e.printStackTrace();
119  }
120 
121  final RsProtectResponse resp = client.umaRsProtect(Tester.getAuthorization(), params).dataAsResponse(RsProtectResponse.class);
122  assertNotNull(resp);
123  return resp;
124  }

◆ protectWithScopeExpression()

void org.xdi.oxd.server.RsProtectTest.protectWithScopeExpression ( String  host,
String  redirectUrl,
String  opHost,
String  rsProtectScopeExpression 
) throws IOException
inline
82  {
83  ClientInterface client = Tester.newClient(host);
84 
85  final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrl);
86 
87  protectResources(client, site, UmaFullTest.resourceList(rsProtectScopeExpression).getResources());
88  RsCheckAccessTest.checkAccess(client, site);
89  }
static RsProtectResponse protectResources(ClientInterface client, RegisterSiteResponse site, List< RsResource > resources)
Definition: RsProtectTest.java:112

◆ protectWithScopeExpressionSeconds()

void org.xdi.oxd.server.RsProtectTest.protectWithScopeExpressionSeconds ( String  host,
String  redirectUrl,
String  opHost,
String  rsProtectScopeExpressionSecond 
) throws IOException
inline
93  {
94  ClientInterface client = Tester.newClient(host);
95 
96  final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrl);
97 
98  protectResources(client, site, UmaFullTest.resourceList(rsProtectScopeExpressionSecond).getResources());
99 
100  final RsCheckAccessParams params = new RsCheckAccessParams();
101  params.setOxdId(site.getOxdId());
102  params.setHttpMethod("GET");
103  params.setPath("/GetAll");
104  params.setRpt("");
105 
106  final RsCheckAccessResponse response = client.umaRsCheckAccess(Tester.getAuthorization(), params).dataAsResponse(RsCheckAccessResponse.class);
107 
108  Assert.assertNotNull(response);
109  Assert.assertTrue(StringUtils.isNotBlank(response.getAccess()));
110  }
static RsProtectResponse protectResources(ClientInterface client, RegisterSiteResponse site, List< RsResource > resources)
Definition: RsProtectTest.java:112

このクラス詳解は次のファイルから抽出されました: