mirror of
https://github.com/ansible/awx.git
synced 2026-04-09 12:09:20 -02:30
Merge pull request #9683 from rebeccahhh/devel
Pull with credentials from protected registries SUMMARY relates to #7066 if a credential is associated with an EE this will create a JSON authfile that is then passed with the pull request to the host of the registry ISSUE TYPE Feature Pull Request COMPONENT NAME API AWX VERSION awx: 18.0.0 TODOs Remove separate token field from the registry credential. Rename the existing password field to say "password/token" Ensure only registry credentials can be associated with an EE #9628 Write out the auth.json file to the pdd_wrapper_ directory. #9683 (comment) Use secure permissions for auth.json #9683 (comment) Reviewed-by: Ryan Petrello <None> Reviewed-by: Shane McDonald <me@shanemcd.com> Reviewed-by: Rebeccah Hunter <rhunter@redhat.com> Reviewed-by: Elijah DeLee <kdelee@redhat.com> Reviewed-by: Alan Rominger <arominge@redhat.com> Reviewed-by: Bianca Henderson <beeankha@gmail.com> Reviewed-by: Nana <natr@hey.com>
This commit is contained in:
@@ -1412,6 +1412,11 @@ class ExecutionEnvironmentSerializer(BaseSerializer):
|
||||
res['credential'] = self.reverse('api:credential_detail', kwargs={'pk': obj.credential.pk})
|
||||
return res
|
||||
|
||||
def validate_credential(self, value):
|
||||
if value and value.kind != 'registry':
|
||||
raise serializers.ValidationError(_('Only Container Registry credentials can be associated with an Execution Environment'))
|
||||
return value
|
||||
|
||||
def validate(self, attrs):
|
||||
# prevent changing organization of ee. Unsetting (change to null) is allowed
|
||||
if self.instance:
|
||||
|
||||
Reference in New Issue
Block a user