Bug 2017774

Summary: [RFE]: Disallow manual subscription attachment in SCA mode
Product: [Community] Candlepin Reporter: Nikos Moumoulidis <nmoumoul>
Component: candlepinAssignee: candlepin-bugs
Status: MODIFIED --- QA Contact:
Severity: medium Docs Contact:
Priority: high    
Version: 4.1CC: ahumbe, peter.vreman, redakkan, saydas, sbakaj, yuefliu
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2332067 (view as bug list) Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2182768    
Bug Blocks: 2023257, 2124343, 2332067    

Description Nikos Moumoulidis 2021-10-27 12:14:32 UTC
Description of problem:
Allowing the manual attachment of subscriptions while in SCA mode was a decision that would make for a smoother transition from Entitlement for users, but we are at a point that this is no longer needed.

Auto-attaching has already been disabled at the Candlepin level, and 
Satellite 6.9+ has already disabled attaching subscriptions to hosts while in SCA mode from the Satellite UI.

Disallowing the attachment of subscriptions at the Candlepin API level by ignoring the specified pool ids, and returning an empty list of entitlements,
is the next natural step (We do not want to throw an error in order to make sure older, unpatched clients do not break).
The only exception would be that we should still allow manifest consumers (e.g. types 'candlepin' or 'satellite') to attach
entitlements for manifest generation to work properly.

Version-Release number of selected component (if applicable):
All current versions of Candlepin.

How reproducible:
100%

Steps to Reproduce:
1. Register a client to an Org that is in SCA mode.
2. Run 'subscription-manager attach --pool=<pool id for subscription X>'  to attach a specific pool

Actual results:
"Successfully attached a subscription for: X"

Expected results:
A descriptive error returned from Candlepin similar to the one of auto-attach, e.g. "Ignoring request to attach entitlements. It is disabled for org "Default_Organization" because of the content access mode setting."

Additional info:

Comment 1 Brad Buckingham 2022-01-10 13:18:02 UTC
*** Bug 2022743 has been marked as a duplicate of this bug. ***

Comment 3 Nikos Moumoulidis 2022-07-19 08:46:01 UTC
*** Bug 2108415 has been marked as a duplicate of this bug. ***