From 1992339923ab02afaed2212dfbaff2f51f8b68cd Mon Sep 17 00:00:00 2001 From: Alexander Olofsson <alexander.olofsson@liu.se> Date: Tue, 31 Jul 2018 15:52:11 +0200 Subject: [PATCH] Limit resource list actions to the documented ones --- lib/passwordstate/client.rb | 9 ++++++--- lib/passwordstate/resources/folder.rb | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/passwordstate/client.rb b/lib/passwordstate/client.rb index 246dfd2..5b5c3e0 100644 --- a/lib/passwordstate/client.rb +++ b/lib/passwordstate/client.rb @@ -28,11 +28,13 @@ module Passwordstate end def folders - ResourceList.new self, Passwordstate::Resources::Folder + ResourceList.new self, Passwordstate::Resources::Folder, + only: %i[all search post] end def hosts - ResourceList.new self, Passwordstate::Resources::Folder + ResourceList.new self, Passwordstate::Resources::Host, + only: %i[search post delete] end def passwords @@ -40,7 +42,8 @@ module Passwordstate end def password_lists - ResourceList.new self, Passwordstate::Resources::PasswordList + ResourceList.new self, Passwordstate::Resources::PasswordList, + except: %i[put delete] end def valid? diff --git a/lib/passwordstate/resources/folder.rb b/lib/passwordstate/resources/folder.rb index bfecbab..6953c08 100644 --- a/lib/passwordstate/resources/folder.rb +++ b/lib/passwordstate/resources/folder.rb @@ -3,6 +3,8 @@ module Passwordstate class Folder < Passwordstate::Resource api_path 'folders' + index_field :folder_id + accessor_fields :folder_name, :description -- GitLab