diff --git a/Gopkg.lock b/Gopkg.lock index 4488ed197..f3dc4f95c 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -296,15 +296,6 @@ revision = "30b4db38fcaf4bf35a545d95c655622b05d8ac35" version = "v0.3.0" -[[projects]] - name = "github.com/ory/hydra" - packages = [ - "pkg", - "rand/sequence" - ] - revision = "93dcbcf3b9e0726c03b45b7e74ec9ca4c89eab03" - version = "v1.0.0-beta.8" - [[projects]] name = "github.com/ory/ladon" packages = [ diff --git a/policy/handler.go b/policy/handler.go index f143b04b7..8c78c68dd 100644 --- a/policy/handler.go +++ b/policy/handler.go @@ -26,7 +26,6 @@ import ( "github.com/julienschmidt/httprouter" "github.com/ory/herodot" - "github.com/ory/hydra/pkg" "github.com/ory/ladon" "github.com/ory/pagination" "github.com/pborman/uuid" @@ -143,7 +142,7 @@ func (h *Handler) Get(w http.ResponseWriter, r *http.Request, ps httprouter.Para policy, err := h.Manager.Get(ps.ByName("id")) if err != nil { if err.Error() == "Not found" { - h.H.WriteError(w, r, errors.WithStack(pkg.ErrNotFound)) + h.H.WriteError(w, r, errors.WithStack(&herodot.ErrorNotFound)) return } h.H.WriteError(w, r, errors.WithStack(err)) diff --git a/role/manager_memory.go b/role/manager_memory.go index 8f50c8624..6d0901f72 100644 --- a/role/manager_memory.go +++ b/role/manager_memory.go @@ -23,7 +23,7 @@ package role import ( "sync" - "github.com/ory/hydra/pkg" + "github.com/ory/herodot" "github.com/ory/pagination" "github.com/pborman/uuid" "github.com/pkg/errors" @@ -54,7 +54,7 @@ func (m *MemoryManager) CreateRole(r *Role) error { func (m *MemoryManager) GetRole(id string) (*Role, error) { if r, ok := m.Roles[id]; !ok { - return nil, errors.WithStack(pkg.ErrNotFound) + return nil, errors.WithStack(&herodot.ErrorNotFound) } else { return &r, nil } diff --git a/role/manager_sql.go b/role/manager_sql.go index be643bb08..0051c25e5 100644 --- a/role/manager_sql.go +++ b/role/manager_sql.go @@ -26,7 +26,7 @@ import ( "fmt" "github.com/jmoiron/sqlx" - "github.com/ory/hydra/pkg" + "github.com/ory/herodot" "github.com/pborman/uuid" "github.com/pkg/errors" "github.com/rubenv/sql-migrate" @@ -102,7 +102,7 @@ func (m *SQLManager) GetRole(id string) (*Role, error) { var q []string if err := m.DB.Select(&q, m.DB.Rebind(fmt.Sprintf("SELECT member from %s WHERE role_id = ?", m.TableMember)), found); err == sql.ErrNoRows { - return nil, errors.WithStack(pkg.ErrNotFound) + return nil, errors.WithStack(&herodot.ErrorNotFound) } else if err != nil { return nil, errors.WithStack(err) } @@ -164,7 +164,7 @@ func (m *SQLManager) RemoveRoleMembers(role string, subjects []string) error { func (m *SQLManager) FindRolesByMember(member string, limit, offset int) ([]Role, error) { var ids []string if err := m.DB.Select(&ids, m.DB.Rebind(fmt.Sprintf("SELECT role_id from %s WHERE member = ? GROUP BY role_id ORDER BY role_id LIMIT ? OFFSET ?", m.TableMember)), member, limit, offset); err == sql.ErrNoRows { - return nil, errors.WithStack(pkg.ErrNotFound) + return nil, errors.WithStack(&herodot.ErrorNotFound) } else if err != nil { return nil, errors.WithStack(err) } @@ -185,7 +185,7 @@ func (m *SQLManager) FindRolesByMember(member string, limit, offset int) ([]Role func (m *SQLManager) ListRoles(limit, offset int) ([]Role, error) { var ids []string if err := m.DB.Select(&ids, m.DB.Rebind(fmt.Sprintf("SELECT id from %s LIMIT ? OFFSET ?", m.TableRole)), limit, offset); err == sql.ErrNoRows { - return nil, errors.WithStack(pkg.ErrNotFound) + return nil, errors.WithStack(&herodot.ErrorNotFound) } else if err != nil { return nil, errors.WithStack(err) }