Package org.sonatype.security.rest.model

Examples of org.sonatype.security.rest.model.AuthenticationLoginResource


        new XStreamRepresentation(XStreamFactory.getXmlXStream(), responseText, MediaType.APPLICATION_XML);

    AuthenticationLoginResourceResponse resourceResponse =
        (AuthenticationLoginResourceResponse) representation.getPayload(new AuthenticationLoginResourceResponse());

    AuthenticationLoginResource resource = resourceResponse.getData();

    return resource.getClientPermissions().getPermissions();
  }
View Full Code Here


        MediaType.APPLICATION_XML);

    AuthenticationLoginResourceResponse resourceResponse = (AuthenticationLoginResourceResponse) representation
        .getPayload(new AuthenticationLoginResourceResponse());

    AuthenticationLoginResource resource = resourceResponse.getData();

    return resource.getClientPermissions();
  }
View Full Code Here

  @Override
  public AuthenticationLoginResourceResponse get(Context context, Request request, Response response, Variant variant)
      throws ResourceException
  {
    AuthenticationLoginResource resource = new AuthenticationLoginResource();

    resource.setClientPermissions(getClientPermissionsForCurrentUser(request));

    AuthenticationLoginResourceResponse result = new AuthenticationLoginResourceResponse();

    result.setData(resource);
View Full Code Here

  }

  @Test
  public void testAuthenticationLoginResourceResponse() {
    AuthenticationLoginResourceResponse resourceResponse = new AuthenticationLoginResourceResponse();
    AuthenticationLoginResource loginResource = new AuthenticationLoginResource();
    AuthenticationClientPermissions perms = new AuthenticationClientPermissions();
    ClientPermission permission = new ClientPermission();
    permission.setId("id");
    permission.setValue(5);
    perms.addPermission(permission);
    perms.setLoggedIn(true);
    perms.setLoggedInUsername("fred");

    loginResource.setClientPermissions(perms);
    resourceResponse.setData(loginResource);

    this.marshalUnmarchalThenCompare(resourceResponse);
    this.validateXmlHasNoPackageNames(resourceResponse);
  }
View Full Code Here

        client.open(server, instance);
   
        if (username != null) {
            log.debug("Logging in");

            AuthenticationLoginResource detail = client.login(username, password);
            AuthenticationClientPermissions perms = detail.getClientPermissions();

            if (perms.isLoggedIn()) {
                // TODO: Add colors

                io.println("User: {}", perms.getLoggedInUsername()); // TODO: i18n
View Full Code Here

TOP

Related Classes of org.sonatype.security.rest.model.AuthenticationLoginResource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.