Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Spray HTTP listener for all ACL related requests
- */
- trait ACLSprayService
- {
- this: CommonSprayService ⇒
- val aclRoute =
- pathPrefix(AuthPath) {
- (pathEnd & post) {
- tracedHandleRest[AuthRequest, AuthResponse]
- } ~
- (pathEnd & delete) {
- tracedHandleRest[LogoutRequest, SuccessResponse.Ok.type]
- } ~
- (path(Segment) & post) { tokenId ⇒
- tracedHandleWith(tokenId :: HNil) {
- restProcess[AuthByTokenRequest, AuthResponse]
- }
- }
- } ~
- (path(InvitationsPath / Segment / InvitationsAcceptPath) & post) { invitationId ⇒
- tracedHandleWith(invitationId :: HNil) {
- restProcess[AcceptInvitationRequest, AuthResponse]
- }
- } ~
- (path(CredentialsPath / CredentialsResetPath) & post) {
- tracedHandleRest[ResetPasswordRequest, NewTokenResponse]
- } ~
- path(AccountsPath / CommonConfig.CVD.RootAccountToken) {
- tracedHandleRest[CreateRootAccountRequest, SuccessResponse.Created.type]
- } ~
- pathPrefix(AccountsPath) {
- pathPrefix(BSONObjectIDSegment) {
- accountId =>
- pathPrefix(CredentialsPath) {
- pathEnd {
- put {
- tracedHandleWith(accountId :: HNil) {
- restProcess[SetPasswordRequest, SuccessResponse.Ok.type]
- }
- }
- } ~
- (path(CredentialsResetPath) & post) {
- tracedHandleWith(accountId :: HNil) {
- restProcess[AdminResetPasswordRequest, NewTokenResponse]
- }
- }
- }
- }
- }
- registerApiRoute(aclRoute)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement