2 * Copyright (c) 2017 Ericsson Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.aaa.shiro.keystone.domain;
11 * This class is a representation of a Keystone API v3 Auth object.
13 public class KeystoneAuth {
14 private final Auth auth;
16 public KeystoneAuth(String username, String password, String domain) {
17 this.auth = new Auth(username, password, domain);
20 public Auth getAuth() {
24 public static final class Auth {
25 private final Identity identity;
26 private final Scope scope;
28 private Auth(String username, String password, String domain) {
29 this.identity = new Identity(username, password, domain);
30 this.scope = new Scope(domain);
33 public Identity getIdentity() {
37 public Scope getScope() {
41 public static final class Identity {
42 private static final String METHOD_PASSWORD = "password";
44 private final String[] methods;
45 private final Password password;
47 private Identity(String username, String password, String domain) {
48 this.password = new Password(username, password, domain);
49 this.methods = new String[]{ METHOD_PASSWORD };
52 public String[] getMethods() {
53 return methods == null ? null : methods.clone();
56 public Password getPassword() {
60 public static final class Password {
61 private final User user;
63 private Password(String username, String password, String domain) {
64 this.user = new User(username, password, domain);
67 public User getUser() {
71 public static final class User {
72 private final String name;
73 private final String password;
74 private final Domain domain;
76 private User(String name, String password, String domain) {
78 this.password = password;
79 this.domain = new Domain(domain);
82 public String getName() {
86 public String getPassword() {
90 public Domain getDomain() {
94 public static final class Domain {
95 private final String name;
97 private Domain(String name) {
101 public String getName() {
110 public static final class Scope {
111 private final Domain domain;
113 public Scope(String domainId) {
114 domain = new Domain(domainId);
117 public Domain getDomain() {
121 public static final class Domain {
122 private final String name;
124 public Domain(String theDomain) {
128 public String getName() {