You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sqoop.apache.org by "Richard (JIRA)" <ji...@apache.org> on 2015/02/09 10:09:34 UTC

[jira] [Comment Edited] (SQOOP-1979) SQOOP2: Rest API support

    [ https://issues.apache.org/jira/browse/SQOOP-1979?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14269004#comment-14269004 ] 

Richard edited comment on SQOOP-1979 at 2/9/15 9:08 AM:
--------------------------------------------------------

Restful call API is handled by org.apache.sqoop.handler.AuthorizationEngine.java in sqoop-server

PUT /authorization/role
Create new role with role_name

DELETE /authorization/role/{role_name}

GET /authorization/role
Show all roles

GET /authorization/principal?role_name={role_name}
Show all principals in role with {role_name}

GET /authorization/role?principal_type={type}&principal_name={name}
Show all roles in principal with {name, type}

PUT /authorization/grant_role
Grant a role to a user/group/role
PUT data of JsonObject role(role_name) and principal (name, type)

PUT /authorization/revoke_role
Revoke a role to a user/group/role
PUT data of JsonObject role(role_name) and principal (name, type)

PUT /authorization/grant_privilege
Grant a privilege to a principal
PUT data of JsonObject principal(name, type) and privilege (resource (name, type), action, with_grant_option)

PUT /authorization/revoke_privilege
Revoke a privilege to a principal
PUT data of JsonObject principal(name, type) and privilege (resource (name, type), action, with_grant_option)
If privilege is null, then revoke all privileges for principal(name, type)

GET /authorization/privilege?principal_type={type}&principal_name={name}&resource_type={type}&resource_name={name}
Show all privileges in principal with {name, type} and resource with {resource_name, resource_type}
If resource is null, then show all privileges in principal with {name, type}


was (Author: richard_zhou):
The following is the related Restful API.

{code}
GET /v1/role/{role_name}
{code}
Return details about one particular role with role_name
Return all of them if role_name is null
{code}
GET /v1/role/principal/name/{name}/type/{type}
{code}
Return all roles the particular principal has with principal (name, type)
{code}
GET /v1/role/privilege/{privilege_name}
{code}
Return all roles with the particular privilege (privilege_name)
{code}
PUT /v1/role
{code}
Create new role with role_name. Put data of JsonObject role (role_name)
Update existing role with old_role_name and new_role_name. Put data of JsonObject old_role (role_name) and new_role (role_name)
{code}
DELETE /v1/role/{role_name}
{code}

{code}
GET /v1/principal/name/{name}/type/{type}
{code}
Return details about one particular principal with name and type
Return all of them if name is null or type is null or both are null
{code}
GET /v1/principal/role/{role_name}
{code}
Return all principals with the particular role (role_name)
{code}
PUT /v1/principal
{code}
Create new principal with name and type. Put data of JsonObject principal (name, type)
Update existing principal with old_name, old_type, new_name, new_type. Put data of JsonObject old_principal (name, type) and new_principal (name, type)
{code}
DELETE /v1/principal/name/{name}/type/{type}
{code}
Delete all of them if name is null or type is null
{code}
PUT /v1/grant_role
{code}
Grant a role to a user/group/role
{code}
PUT data of JsonObject role(role_name) and principal (name, type)
{code}
PUT /v1/revoke_role
{code}
Revoke a role to a user/group/role
{code}
PUT data of JsonObject role(role_name) and principal (name, type)
{code}
GET /v1/resource/name/{name}/type/{type}
{code}
Return details about one particular resource with name and type
Return all of them if name is null or type is null or both are null
{code}
PUT /v1/resource
{code}
Create new resource with name and type. Put data of JsonObject resource (name, type)
Update existing resource with old_name, old_type, new_name, new_type. Put data of JsonObject old_resource (name, type) and new_resource (name, type)
{code}
DELETE /v1/resource/name/{name}/type/{type}
{code}
Delete all of them if name is null or type is null
{code}
GET /v1/privilege/{privilege_name}
{code}
Return details about one particular privilege with privilege_name
Return all of them if name is null or type is null or both are null
{code}
GET /v1/privilege/resource/name/{name}/type/{type}
{code}
Return all privilege with the particular principal (name, type)
{code}
GET /v1/privilege/role/{role_name}
{code}
Return all privilege with the particular role (role_name)
{code}
PUT /v1/privilege
{code}
Create new privilege with resource, action and with_grant_option. Put data of JsonObject resource (name, type), action and with_grant_option
Update existing privilege with old_resource, old_action, old_with_grant_option, new_resource, new_action and new_with_grant_option. Put data of JsonObject old_privilege (resource (name, type), action, with_grant_option) and new_privilege (resource (name, type), action, with_grant_option)
{code}
DELETE /v1/privilege/{privilege_name}
DELETE /v1/resource/name/{name}/type/{type}
DELETE /v1/resource/name/{name}/type/{type}/action/{action}/with_grant_option/{with_grant_option}
{code}

{code}
PUT /v1/grant_privilege
{code}
Grant a privilege to a role
PUT data of JsonObject role(role_name) and privilege (name)
{code}
PUT /v1/revoke_privilege
{code}
Revoke a privilege to a role
PUT data of JsonObject role(role_name) and privilege (name)

> SQOOP2: Rest API support
> ------------------------
>
>                 Key: SQOOP-1979
>                 URL: https://issues.apache.org/jira/browse/SQOOP-1979
>             Project: Sqoop
>          Issue Type: Sub-task
>          Components: sqoop2-framework
>            Reporter: Richard
>            Assignee: Richard
>             Fix For: 1.99.7
>
>         Attachments: SQOOP-1979.0.patch
>
>
> Handle Rest API in server side to grant/revoke role, etc.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)