fix: Fix policy template mapping and update credential labels in QuickStartWizard
- Fix 'Invalid template' error by correctly mapping policy types to template keys - 'readwrite' -> 'bucketFullAccess' - 'readonly' -> 'bucketReadOnly' - 'writeonly' -> 'bucketWriteOnly' - Update user creation form labels to 'Username (Access Key)' and 'Password (Secret Key)' - Update review section to show consistent MinIO credential terminology - Add helpful text explaining these are MinIO credentials This ensures the QuickStartWizard creates policies correctly and maintains consistent credential terminology across all UI components. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -135,8 +135,16 @@ const QuickStartWizard: React.FC<QuickStartWizardProps> = ({
|
||||
|
||||
// Step 3: Create policy
|
||||
const policyName = `${setupData.bucketName}-${setupData.policyType}-policy`;
|
||||
|
||||
// Map policy types to template keys
|
||||
const templateKey = setupData.policyType === 'readwrite'
|
||||
? 'bucketFullAccess'
|
||||
: setupData.policyType === 'readonly'
|
||||
? 'bucketReadOnly'
|
||||
: 'bucketWriteOnly';
|
||||
|
||||
const policyJson = policyService.generatePolicyFromTemplate(
|
||||
`bucket${setupData.policyType.charAt(0).toUpperCase() + setupData.policyType.slice(1).replace('only', 'Only')}`,
|
||||
templateKey,
|
||||
setupData.bucketName
|
||||
);
|
||||
|
||||
@@ -220,21 +228,22 @@ const QuickStartWizard: React.FC<QuickStartWizardProps> = ({
|
||||
<TextField
|
||||
autoFocus
|
||||
margin="normal"
|
||||
label="Username"
|
||||
label="Username (Access Key)"
|
||||
fullWidth
|
||||
value={setupData.userName}
|
||||
onChange={(e) => setSetupData({ ...setupData, userName: e.target.value })}
|
||||
error={!!error && activeStep === 1}
|
||||
helperText="This will be the user's Access Key for MinIO"
|
||||
/>
|
||||
<TextField
|
||||
margin="normal"
|
||||
label="Password"
|
||||
label="Password (Secret Key)"
|
||||
type={showPassword ? 'text' : 'password'}
|
||||
fullWidth
|
||||
value={setupData.userPassword}
|
||||
onChange={(e) => setSetupData({ ...setupData, userPassword: e.target.value })}
|
||||
error={!!error && activeStep === 1}
|
||||
helperText={error || "Min 8 chars, uppercase, lowercase, and number required"}
|
||||
helperText={error || "This will be the user's Secret Key - Min 8 chars, uppercase, lowercase, and number"}
|
||||
InputProps={{
|
||||
endAdornment: (
|
||||
<InputAdornment position="end">
|
||||
@@ -317,7 +326,7 @@ const QuickStartWizard: React.FC<QuickStartWizardProps> = ({
|
||||
<Person color="primary" />
|
||||
</ListItemIcon>
|
||||
<ListItemText
|
||||
primary="User"
|
||||
primary="User (Access Key)"
|
||||
secondary={setupData.userName}
|
||||
/>
|
||||
</ListItem>
|
||||
@@ -326,7 +335,7 @@ const QuickStartWizard: React.FC<QuickStartWizardProps> = ({
|
||||
<VpnKey color="primary" />
|
||||
</ListItemIcon>
|
||||
<ListItemText
|
||||
primary="Password"
|
||||
primary="Password (Secret Key)"
|
||||
secondary="••••••••••••••••"
|
||||
/>
|
||||
</ListItem>
|
||||
|
||||
Reference in New Issue
Block a user