Interface FiatService


  • public interface FiatService
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      retrofit.client.Response canCreate​(java.lang.String userId, java.lang.String resourceType, java.lang.Object resource)
      Determine whether the user can create a resource.
      com.netflix.spinnaker.fiat.model.UserPermission.View getUserPermission​(java.lang.String userId)  
      retrofit.client.Response hasAuthorization​(java.lang.String userId, java.lang.String resourceType, java.lang.String resourceName, java.lang.String authorization)  
      retrofit.client.Response loginUser​(java.lang.String userId, java.lang.String ignored)  
      retrofit.client.Response loginWithRoles​(java.lang.String userId, java.util.Collection<java.lang.String> roles)
      Used specifically for logins that contain the users roles/groups.
      retrofit.client.Response logoutUser​(java.lang.String userId)  
      long sync()
      Use to update all users.
      long sync​(java.util.List<java.lang.String> roles)
      Use to update a subset of users.
    • Method Detail

      • getUserPermission

        @GET("/authorize/{userId}")
        com.netflix.spinnaker.fiat.model.UserPermission.View getUserPermission​(@Path("userId")
                                                                               java.lang.String userId)
        Parameters:
        userId - The username of the user
        Returns:
        The full UserPermission of the user.
      • hasAuthorization

        @GET("/authorize/{userId}/{resourceType}/{resourceName}/{authorization}")
        retrofit.client.Response hasAuthorization​(@Path("userId")
                                                  java.lang.String userId,
                                                  @Path("resourceType")
                                                  java.lang.String resourceType,
                                                  @Path("resourceName")
                                                  java.lang.String resourceName,
                                                  @Path("authorization")
                                                  java.lang.String authorization)
        Parameters:
        userId - The username of the user
        resourceType - The resource type in question (application, account, etc.)
        resourceName - The name of the resource
        authorization - The authorization in question (read, write, etc)
        Returns:
        True if the user has access to the specified resource.
      • canCreate

        @POST("/authorize/{userId}/{resourceType}/create")
        retrofit.client.Response canCreate​(@Path("userId")
                                           java.lang.String userId,
                                           @Path("resourceType")
                                           java.lang.String resourceType,
                                           @Body
                                           java.lang.Object resource)
        Determine whether the user can create a resource. Returns 200 if the user can, throws 404 otherwise
        Parameters:
        userId - The username of the user
        resourceType - The type of the resource
        resource - The resource to check
      • sync

        @POST("/roles/sync")
        long sync()
        Use to update all users.
        Returns:
        The number of non-anonymous users synced.
      • sync

        @POST("/roles/sync")
        long sync​(@Body
                  java.util.List<java.lang.String> roles)
        Use to update a subset of users. An empty list will update the anonymous/unrestricted user.
        Parameters:
        roles - Users with any role listed should be updated.
        Returns:
        The number of non-anonymous users synced.
      • loginUser

        @POST("/roles/{userId}")
        retrofit.client.Response loginUser​(@Path("userId")
                                           java.lang.String userId,
                                           @Body
                                           java.lang.String ignored)
        Parameters:
        userId - The user being logged in
        ignored - ignored.
        Returns:
        ignored.
      • loginWithRoles

        @PUT("/roles/{userId}")
        retrofit.client.Response loginWithRoles​(@Path("userId")
                                                java.lang.String userId,
                                                @Body
                                                java.util.Collection<java.lang.String> roles)
        Used specifically for logins that contain the users roles/groups.
        Parameters:
        userId - The user being logged in
        roles - Collection of roles from the identity provider
        Returns:
        ignored.
      • logoutUser

        @DELETE("/roles/{userId}")
        retrofit.client.Response logoutUser​(@Path("userId")
                                            java.lang.String userId)
        Parameters:
        userId - The user being logged out
        Returns:
        ignored.