-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
44 add dco acceptance #45
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
46580b2
Add initial DCO acceptance page, endpoints, and update handler to req…
CheesyLaZanya 72f171d
Merge branch '9-oauth2-authentication-using-multiple-providers' into …
CheesyLaZanya 7f1af2f
Add DCO migration, fix DCO endpoints and ensure accepting DCO redirec…
CheesyLaZanya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.dng | ||
*.jpg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...les/odr_datamodel/alembic/versions/a72b966658fb_add_dco_accepted_column_to_users_table.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
"""'Add dco_accepted column to users table' | ||
|
||
Revision ID: a72b966658fb | ||
Revises: 266a32db1499 | ||
Create Date: 2024-09-16 18:44:44.335931 | ||
|
||
""" | ||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy.dialects import postgresql | ||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = 'a72b966658fb' | ||
down_revision: Union[str, None] = '266a32db1499' | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
op.add_column('users', sa.Column('dco_accepted', sa.Boolean(), nullable=False, server_default='false')) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
op.drop_column('users', 'dco_accepted') | ||
# ### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { redirect, fail } from '@sveltejs/kit'; | ||
import { ENV } from '$lib/server/env'; | ||
import type { Actions } from './$types'; | ||
|
||
export const actions: Actions = { | ||
default: async (event) => { | ||
const formData = await event.request.formData(); | ||
const acceptDCO = formData.get('acceptDCO'); | ||
|
||
if (!acceptDCO) { | ||
return fail(400, { message: 'You must accept the DCO to continue' }); | ||
} | ||
|
||
let response; | ||
|
||
try { | ||
response = await fetch(`${ENV.API_SERVICE_URL}/users/accept-dco`, { | ||
method: 'POST', | ||
headers: { | ||
'Content-Type': 'application/json', | ||
Cookie: event.request.headers.get('cookie') || '' | ||
} | ||
}); | ||
} catch (error) { | ||
console.error('Network error accepting DCO:', error); | ||
return fail(500, { message: 'A network error occurred while processing your request' }); | ||
} | ||
|
||
if (response.ok) { | ||
throw redirect(302, '/'); | ||
} else { | ||
const errorData = await response.json(); | ||
return fail(response.status, { message: errorData.message || 'Failed to accept DCO' }); | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<script lang="ts"> | ||
import { enhance } from '$app/forms'; | ||
|
||
let acceptedDCO = false; | ||
</script> | ||
|
||
<svelte:head> | ||
<title>DCO | OMI Data Pipeline</title> | ||
</svelte:head> | ||
|
||
<div class="flex flex-col overflow-y-auto"> | ||
<main class="container mx-auto p-4"> | ||
<h1 class="text-3xl font-bold mb-4">Developer Certificate of Origin</h1> | ||
<h2 class="text-xl mb-2">Version 1.1</h2> | ||
|
||
<div class="bg-gray-800 p-4 rounded-lg mb-4 whitespace-pre-wrap text-gray-200"> | ||
{`Copyright (C) 2004, 2006 The Linux Foundation and its contributors. | ||
1 Letterman Drive | ||
Suite D4700 | ||
San Francisco, CA, 94129 | ||
|
||
Everyone is permitted to copy and distribute verbatim copies of this | ||
license document, but changing it is not allowed. | ||
|
||
|
||
Developer's Certificate of Origin 1.1 | ||
|
||
By making a contribution to this project, I certify that: | ||
|
||
(a) The contribution was created in whole or in part by me and I | ||
have the right to submit it under the open source license | ||
indicated in the file; or | ||
|
||
(b) The contribution is based upon previous work that, to the best | ||
of my knowledge, is covered under an appropriate open source | ||
license and I have the right under that license to submit that | ||
work with modifications, whether created in whole or in part | ||
by me, under the same open source license (unless I am | ||
permitted to submit under a different license), as indicated | ||
in the file; or | ||
|
||
(c) The contribution was provided directly to me by some other | ||
person who certified (a), (b) or (c) and I have not modified | ||
it. | ||
|
||
(d) I understand and agree that this project and the contribution | ||
are public and that a record of the contribution (including all | ||
personal information I submit with it, including my sign-off) is | ||
maintained indefinitely and may be redistributed consistent with | ||
this project or the open source license(s) involved.`} | ||
</div> | ||
|
||
<form method="POST" use:enhance> | ||
<div class="mb-4"> | ||
<label class="flex items-center"> | ||
<input type="checkbox" bind:checked={acceptedDCO} name="acceptDCO" class="mr-2"> | ||
<span>I accept the terms of the Developer Certificate of Origin</span> | ||
</label> | ||
</div> | ||
<button | ||
type="submit" | ||
class="bg-blue-500 text-white px-4 py-2 rounded transition-colors duration-200 ease-in-out | ||
disabled:opacity-50 disabled:cursor-not-allowed hover:bg-blue-600" | ||
disabled={!acceptedDCO} | ||
> | ||
Accept DCO | ||
</button> | ||
</form> | ||
</main> | ||
</div> | ||
|
||
<style> | ||
.container { | ||
max-width: 800px; | ||
padding-bottom: 2rem; | ||
} | ||
</style> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we cite the "open source license indicated in the file" anywhere in this screen? We might want to clarify that point. If this will be a dataset, I believe its CDLA 2.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hipsterusername No we don't mention the specific license anywhere.
To clarify are you suggesting updating the wording of the DCO here to add a line specifying the license, or should we just have a line above/before the DCO block stating like "The following Developer Certificate of Origin agreement covers all contributions to Open Model Initiative Datasets. All OMI datasets will fall under the CDLA 2.0 license" perhaps with a link to https://cdla.dev/permissive-2-0/ ?
Just wanting to make sure I understand the spec or expected wording updates correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I think we just need to highlight which license applies in the UI somewhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay thanks, I will add the line and link in a quick subsequent PR. 👍